diff --git a/0004-remove-mock-dep.patch b/0004-remove-mock-dep.patch new file mode 100644 index 0000000000000000000000000000000000000000..294fe97bf0afee594ba445db4695c56233168f75 --- /dev/null +++ b/0004-remove-mock-dep.patch @@ -0,0 +1,117 @@ +Prefer and use built-in unittest.mock in Python 3.3+ instead +of unnecessarily requiring the external mock package. This helps +distributions that are phasing out Python 2 to remove redundant +packages. + +--- a/dev-requirements.txt ++++ b/dev-requirements.txt +@@ -4,7 +4,7 @@ invocations==2.6.0 + pytest==4.4.2 + # pytest-xdist for test dir watching and the inv guard task + pytest-xdist==1.28.0 +-mock==2.0.0 ++mock==2.0.0;python_version<"3.3" + # Linting! + flake8==3.8.3 + # Formatting! +--- a/tests/test_channelfile.py ++++ b/tests/test_channelfile.py +@@ -1,4 +1,7 @@ +-from mock import patch, MagicMock ++try: ++ from unittest.mock import patch, MagicMock ++except ImportError: ++ from mock import patch, MagicMock + + from paramiko import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile + +--- a/tests/test_client.py ++++ b/tests/test_client.py +@@ -34,7 +34,10 @@ import weakref + from tempfile import mkstemp + + import pytest +-from mock import patch, Mock ++try: ++ from unittest.mock import patch, Mock ++except ImportError: ++ from mock import patch, Mock + + import paramiko + from paramiko import SSHClient +--- a/tests/test_config.py ++++ b/tests/test_config.py +@@ -11,7 +11,11 @@ try: + except ImportError: + Result = None + +-from mock import patch ++try: ++ from unittest.mock import patch ++except ImportError: ++ from mock import patch ++ + from pytest import raises, mark, fixture + + from paramiko import ( +--- a/tests/test_kex.py ++++ b/tests/test_kex.py +@@ -24,7 +24,11 @@ from binascii import hexlify, unhexlify + import os + import unittest + +-from mock import Mock, patch ++try: ++ from unittest.mock import Mock, patch ++except ImportError: ++ from mock import Mock, patch ++ + import pytest + + from cryptography.hazmat.backends import default_backend +--- a/tests/test_pkey.py ++++ b/tests/test_pkey.py +@@ -41,7 +41,12 @@ from paramiko.common import o600 + + from cryptography.exceptions import UnsupportedAlgorithm + from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateNumbers +-from mock import patch, Mock ++ ++try: ++ from unittest.mock import patch, Mock ++except ImportError: ++ from mock import patch, Mock ++ + import pytest + + from .util import _support, is_low_entropy, requires_sha1_signing +--- a/tests/test_proxy.py ++++ b/tests/test_proxy.py +@@ -1,7 +1,11 @@ + import signal + import socket + +-from mock import patch ++try: ++ from unittest.mock import patch ++except ImportError: ++ from mock import patch ++ + from pytest import raises + + from paramiko import ProxyCommand, ProxyCommandFailure +--- a/tests/test_transport.py ++++ b/tests/test_transport.py +@@ -30,7 +30,11 @@ import time + import threading + import random + import unittest +-from mock import Mock ++ ++try: ++ from unittest.mock import Mock ++except ImportError: ++ from mock import Mock + + from paramiko import ( + AuthHandler, diff --git a/backport-Skip-tests-requiring-invoke.patch b/backport-Skip-tests-requiring-invoke.patch deleted file mode 100644 index 3499e8d3b7b713378b0ecf88c8beda9dbd92122a..0000000000000000000000000000000000000000 --- a/backport-Skip-tests-requiring-invoke.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2dc654a20c4f1908d587060809a9d67b31352497 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= -Date: Thu, 16 Apr 2020 09:46:39 +0200 -Subject: [PATCH] Skip tests requiring invoke if it's not installed - -Since invoke is an optional dependency and only one group of tests -require it, skip them gracefully rather than failing if it's not -present. ---- - tests/test_config.py | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/tests/test_config.py b/tests/test_config.py -index 5e9aa0592..2095061f2 100644 ---- a/tests/test_config.py -+++ b/tests/test_config.py -@@ -6,7 +6,11 @@ - - from paramiko.py3compat import string_types - --from invoke import Result -+try: -+ from invoke import Result -+except ImportError: -+ Result = None -+ - from mock import patch - from pytest import raises, mark, fixture - -@@ -705,6 +709,7 @@ def inner(command, *args, **kwargs): - return inner - - -+@mark.skipif(Result is None, reason="requires invoke package") - class TestMatchExec(object): - @patch("paramiko.config.invoke", new=None) - @patch("paramiko.config.invoke_import_error", new=ImportError("meh")) diff --git a/paramiko-2.11.0.tar.gz b/paramiko-2.11.0.tar.gz deleted file mode 100644 index f9a3aac5e784c159790147a2f3ecf9aa3a42d239..0000000000000000000000000000000000000000 Binary files a/paramiko-2.11.0.tar.gz and /dev/null differ diff --git a/paramiko-2.12.0.tar.gz b/paramiko-2.12.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..ec10adb6d54e3d50a9a040c9c0334bf85b4cdd20 Binary files /dev/null and b/paramiko-2.12.0.tar.gz differ diff --git a/python-paramiko.spec b/python-paramiko.spec index 68c4c94a62f048734261b5d92484ff4f416385c5..521638bc92c962f464f00542fa7887559b2f6874 100644 --- a/python-paramiko.spec +++ b/python-paramiko.spec @@ -1,5 +1,5 @@ Name: python-paramiko -Version: 2.11.0 +Version: 2.12.0 Release: 1 Summary: Python SSH module License: LGPLv2+ @@ -8,8 +8,8 @@ Source0: https://github.com/paramiko/paramiko/archive/%{version}/paramiko- # Skip tests requiring invoke if it's not installed # Can be removed when https://github.com/paramiko/paramiko/pull/1667/ is released -Patch6000: backport-Skip-tests-requiring-invoke.patch Patch6001: 0003-remove-pytest-relaxed-dep.patch +Patch6002: 0004-remove-mock-dep.patch BuildArch: noarch @@ -46,7 +46,8 @@ This is the documentation and demos for python-paramiko. %prep %autosetup -p1 -n paramiko-%{version} - +chmod -c a-x demos/* +sed -i -e '/^#!/,1d' demos/* %build %py3_build @@ -69,6 +70,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-%{python3_version} %doc html/ demos/ NEWS README.rst %changelog +* Wed Nov 30 2022 dingdingaaaaa - 2.12.0-1 +- upgrade version to 2.12.0 + * Thu Jun 23 2022 houyingchao - 2.11.0-1 - Upgrade to version 2.11.0