14
0
forked from pool/python-Fabric

Accepting request 977640 from devel:languages:python

- Update to 2.7.0:
  * Add ~fabric.connection.Connection.shell, a belated port of the v1
    open_shell() feature.
  * Forward local terminal resizes to the remote end, when applicable.
    (For the technical: this means we now turn SIGWINCH into SSH
    window-change messages.)
  * Update ~fabric.connection.Connection temporarily so that it doesn't
    incidentally apply replace_env=True to local shell commands, only
    remote ones.
- Add patch remove-mock.patch:
  * Use unittest.mock, instead of mock

OBS-URL: https://build.opensuse.org/request/show/977640
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Fabric?expand=0&rev=38
This commit is contained in:
2022-05-17 15:24:32 +00:00
committed by Git OBS Bridge
5 changed files with 227 additions and 9 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47f184b070272796fd2f9f0436799e18f2ccba4ee8ee587796fca192acd46cd2
size 163880

3
fabric-2.7.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0bf797a68c4b389720dc4dd6181497a58c41ed762e283d9e3c1b0148b32a9aff
size 166019

View File

@@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue May 17 05:29:37 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 2.7.0:
* Add ~fabric.connection.Connection.shell, a belated port of the v1
open_shell() feature.
* Forward local terminal resizes to the remote end, when applicable.
(For the technical: this means we now turn SIGWINCH into SSH
window-change messages.)
* Update ~fabric.connection.Connection temporarily so that it doesn't
incidentally apply replace_env=True to local shell commands, only
remote ones.
- Add patch remove-mock.patch:
* Use unittest.mock, instead of mock
-------------------------------------------------------------------
Thu Mar 10 06:31:30 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -18,19 +18,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Fabric
Version: 2.6.0
Version: 2.7.0
Release: 0
Summary: A Pythonic tool for remote execution and deployment
License: BSD-2-Clause
Group: Development/Languages/Python
URL: http://fabfile.org
Source: https://files.pythonhosted.org/packages/source/f/fabric/fabric-%{version}.tar.gz
# fix executable in tests
# PATCH-FIX-UPSTREAM gh#fabric/fabric#2209
Patch0: fix-executable.patch
# PATCH-FIX-UPSTREAM gh#fabric/fabric#2210
Patch1: remove-mock.patch
BuildRequires: %{python_module cryptography >= 1.1}
BuildRequires: %{python_module decorator}
BuildRequires: %{python_module invoke >= 1.3}
BuildRequires: %{python_module mock >= 2.0.0}
BuildRequires: %{python_module paramiko >= 2.4}
BuildRequires: %{python_module pytest-relaxed}
BuildRequires: %{python_module setuptools}
@@ -72,10 +72,9 @@ suite at a higher level than that provided by e.g. Paramiko (which
Fabric itself leverages).
%prep
%setup -q -n fabric-%{version}
%autosetup -p1 -n fabric-%{version}
# fix all imports:
sed -i 's/from invoke.vendor\./from\ /' fabric/connection.py fabric/group.py integration/concurrency.py tests/config.py tests/transfer.py tests/_util.py tests/connection.py tests/runners.py
%patch0 -p1
%build
%python_build

204
remove-mock.patch Normal file
View File

@@ -0,0 +1,204 @@
Index: fabric-2.7.0/fabric/testing/base.py
===================================================================
--- fabric-2.7.0.orig/fabric/testing/base.py
+++ fabric-2.7.0/fabric/testing/base.py
@@ -20,7 +20,10 @@ from io import BytesIO
import os
try:
- from mock import Mock, PropertyMock, call, patch, ANY
+ try:
+ from unittest.mock import Mock, PropertyMock, call, patch, ANY
+ except ImportError:
+ from mock import Mock, PropertyMock, call, patch, ANY
except ImportError:
import warnings
Index: fabric-2.7.0/fabric/testing/fixtures.py
===================================================================
--- fabric-2.7.0.orig/fabric/testing/fixtures.py
+++ fabric-2.7.0/fabric/testing/fixtures.py
@@ -17,7 +17,10 @@ For example, if you intend to use the `r
try:
from pytest import fixture
- from mock import patch, Mock
+ try:
+ from unittest.mock import patch, Mock
+ except ImportError:
+ from mock import patch, Mock
except ImportError:
import warnings
Index: fabric-2.7.0/setup.py
===================================================================
--- fabric-2.7.0.orig/setup.py
+++ fabric-2.7.0/setup.py
@@ -77,8 +77,9 @@ setuptools.setup(
},
install_requires=["invoke>=1.3,<2.0", "paramiko>=2.4", "pathlib2"],
extras_require={
- "testing": testing_deps,
- "pytest": testing_deps + pytest_deps,
+ "testing:python_version<='3.3'": testing_deps,
+ "pytest:python_version<='3.3'": testing_deps + pytest_deps,
+ "pytest:python_version>='3.4'": pytest_deps,
},
packages=packages,
entry_points={
Index: fabric-2.7.0/tests/config.py
===================================================================
--- fabric-2.7.0.orig/tests/config.py
+++ fabric-2.7.0/tests/config.py
@@ -8,7 +8,10 @@ from lexicon import Lexicon
from fabric import Config, Remote, RemoteShell
from fabric.util import get_local_user
-from mock import patch, call
+try:
+ from unittest.mock import patch, call
+except ImportError:
+ from mock import patch, call
from _util import support, faux_v1_env
Index: fabric-2.7.0/tests/conftest.py
===================================================================
--- fabric-2.7.0.orig/tests/conftest.py
+++ fabric-2.7.0/tests/conftest.py
@@ -5,7 +5,10 @@ from os.path import isfile, expanduser
from pytest import fixture
-from mock import patch
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
# TODO: does this want to end up in the public fixtures module too?
Index: fabric-2.7.0/tests/connection.py
===================================================================
--- fabric-2.7.0.orig/tests/connection.py
+++ fabric-2.7.0/tests/connection.py
@@ -10,7 +10,10 @@ from os.path import join
import socket
import time
-from mock import patch, Mock, call, ANY
+try:
+ from unittest.mock import patch, Mock, call, ANY
+except ImportError:
+ from mock import patch, Mock, call, ANY
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko import SSHConfig
import pytest # for mark, internal raises
Index: fabric-2.7.0/tests/executor.py
===================================================================
--- fabric-2.7.0.orig/tests/executor.py
+++ fabric-2.7.0/tests/executor.py
@@ -4,7 +4,10 @@ from fabric import Executor, Task, Conne
from fabric.executor import ConnectionCall
from fabric.exceptions import NothingToDo
-from mock import Mock
+try:
+ from unittest.mock import Mock
+except ImportError:
+ from mock import Mock
from pytest import skip, raises # noqa
Index: fabric-2.7.0/tests/group.py
===================================================================
--- fabric-2.7.0.orig/tests/group.py
+++ fabric-2.7.0/tests/group.py
@@ -1,4 +1,7 @@
-from mock import Mock, patch, call
+try:
+ from unittest.mock import Mock, patch, call
+except ImportError:
+ from mock import Mock, patch, call
from pytest import mark, raises
from fabric import Connection, Group, SerialGroup, ThreadingGroup, GroupResult
Index: fabric-2.7.0/tests/main.py
===================================================================
--- fabric-2.7.0.orig/tests/main.py
+++ fabric-2.7.0/tests/main.py
@@ -8,7 +8,10 @@ import re
from invoke import run
from invoke.util import cd
-from mock import patch
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
import pytest # because WHY would you expose @skip normally? -_-
from pytest_relaxed import raises
Index: fabric-2.7.0/tests/runners.py
===================================================================
--- fabric-2.7.0.orig/tests/runners.py
+++ fabric-2.7.0/tests/runners.py
@@ -3,7 +3,10 @@ try:
except ImportError:
from six import StringIO
-from mock import Mock, patch
+try:
+ from unittest.mock import Mock, patch
+except ImportError:
+ from mock import Mock, patch
from pytest import skip # noqa
from invoke import pty_size, Result
Index: fabric-2.7.0/tests/task.py
===================================================================
--- fabric-2.7.0.orig/tests/task.py
+++ fabric-2.7.0/tests/task.py
@@ -1,6 +1,9 @@
# NOTE: named task.py, not tasks.py, to avoid some occasional pytest weirdness
-from mock import Mock
+try:
+ from unittest.mock import Mock
+except ImportError:
+ from mock import Mock
from pytest import skip # noqa
import fabric
Index: fabric-2.7.0/tests/transfer.py
===================================================================
--- fabric-2.7.0.orig/tests/transfer.py
+++ fabric-2.7.0/tests/transfer.py
@@ -3,7 +3,10 @@ try:
except ImportError:
from six import StringIO
-from mock import Mock, call, patch
+try:
+ from unittest.mock import Mock, call, patch
+except ImportError:
+ from mock import Mock, call, patch
from pytest_relaxed import raises
from pytest import skip # noqa
from paramiko import SFTPAttributes
Index: fabric-2.7.0/tests/util.py
===================================================================
--- fabric-2.7.0.orig/tests/util.py
+++ fabric-2.7.0/tests/util.py
@@ -2,7 +2,10 @@
Tests testing the fabric.util module, not utils for the tests!
"""
-from mock import patch
+try:
+ from unittest.mock import patch
+except ImportError:
+ from mock import patch
from fabric.util import get_local_user