From 112ba09ad17d0f66fd7e284c2792f94b8d54884d Mon Sep 17 00:00:00 2001 From: zhanzhimin Date: Mon, 28 Feb 2022 16:24:36 +0800 Subject: [PATCH] drop invoke dependencies (cherry picked from commit c3881946aec4630ab2c80779414f6e49089423bd) --- backport-Skip-tests-requiring-invoke.patch | 37 ++++++++++++++++++++++ python-paramiko.spec | 12 +++++-- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 backport-Skip-tests-requiring-invoke.patch diff --git a/backport-Skip-tests-requiring-invoke.patch b/backport-Skip-tests-requiring-invoke.patch new file mode 100644 index 0000000..3499e8d --- /dev/null +++ b/backport-Skip-tests-requiring-invoke.patch @@ -0,0 +1,37 @@ +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/python-paramiko.spec b/python-paramiko.spec index 2804c6e..a584cd9 100644 --- a/python-paramiko.spec +++ b/python-paramiko.spec @@ -1,12 +1,15 @@ Name: python-paramiko Version: 2.8.1 -Release: 1 +Release: 2 Summary: Python SSH module License: LGPLv2+ URL: https://github.com/paramiko/paramiko Source0: https://github.com/paramiko/paramiko/archive/%{version}/paramiko-%{version}.tar.gz Patch0: paramiko-2.7.2-drop-pytest-relaxed.patch +# 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 BuildArch: noarch @@ -19,9 +22,9 @@ connections to remote machines. Summary: Python SSH module BuildRequires: python3-devel python3-setuptools python3-bcrypt >= 3.1.3 python3-pytest BuildRequires: python3-cryptography >= 2.5 python3-pyasn1 >= 0.1.7 python3-pynacl >= 1.0.1 -BuildRequires: python3-invoke >= 1.3 python3-mock >= 2.0 +BuildRequires: python3-mock >= 2.0 Requires: python3-bcrypt >= 3.1.3 python3-cryptography >= 1.5 -Requires: python3-pyasn1 >= 0.1.7 python3-pynacl >= 1.0.1 python3-invoke >= 1.3 +Requires: python3-pyasn1 >= 0.1.7 python3-pynacl >= 1.0.1 %{?python_provide:%python_provide python3-paramiko} %description -n python3-paramiko @@ -66,6 +69,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-%{python3_version} %doc html/ demos/ NEWS README.rst %changelog +* Sat Feb 26 2022 zhanzhimin - 2.8.1-2 +- drop invoke dependencies as it requires ancient pytest + * Wed Dec 01 2021 zhanzhimin - 2.8.1-1 - update to 2.8.1 -- Gitee