From b609df7bbe6f4e73bf8d6d21cc70ec2ab44bb72e Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Fri, 13 May 2022 20:15:16 +0200 Subject: [PATCH] python3-paramiko: update to 2.10.4. --- .../patches/remove-invoke-check-dep.patch | 39 +++++++++++++++ .../patches/remove-pytest-relaxed-dep.patch | 48 +++++++++++++++++++ srcpkgs/python3-paramiko/template | 11 +++-- 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/python3-paramiko/patches/remove-invoke-check-dep.patch create mode 100644 srcpkgs/python3-paramiko/patches/remove-pytest-relaxed-dep.patch diff --git a/srcpkgs/python3-paramiko/patches/remove-invoke-check-dep.patch b/srcpkgs/python3-paramiko/patches/remove-invoke-check-dep.patch new file mode 100644 index 000000000000..ebcbb233e385 --- /dev/null +++ b/srcpkgs/python3-paramiko/patches/remove-invoke-check-dep.patch @@ -0,0 +1,39 @@ +https://github.com/paramiko/paramiko/pull/1667 + +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/srcpkgs/python3-paramiko/patches/remove-pytest-relaxed-dep.patch b/srcpkgs/python3-paramiko/patches/remove-pytest-relaxed-dep.patch new file mode 100644 index 000000000000..5c4e4f83672d --- /dev/null +++ b/srcpkgs/python3-paramiko/patches/remove-pytest-relaxed-dep.patch @@ -0,0 +1,48 @@ +https://github.com/paramiko/paramiko/pull/1665 + +--- a/tests/test_client.py ++++ b/tests/test_client.py +@@ -33,7 +33,7 @@ import warnings + import weakref + from tempfile import mkstemp + +-from pytest_relaxed import raises ++import pytest + from mock import patch, Mock + + import paramiko +@@ -687,10 +687,10 @@ class PasswordPassphraseTests(ClientTest): + + # TODO: more granular exception pending #387; should be signaling "no auth + # methods available" because no key and no password +- @raises(SSHException) + def test_passphrase_kwarg_not_used_for_password_auth(self): +- # Using the "right" password in the "wrong" field shouldn't work. +- self._test_connection(passphrase="pygmalion") ++ with pytest.raises(SSHException): ++ # Using the "right" password in the "wrong" field shouldn't work. ++ self._test_connection(passphrase="pygmalion") + + def test_passphrase_kwarg_used_for_key_passphrase(self): + # Straightforward again, with new passphrase kwarg. +@@ -708,14 +708,14 @@ class PasswordPassphraseTests(ClientTest): + password="television", + ) + +- @raises(AuthenticationException) # TODO: more granular + def test_password_kwarg_not_used_for_passphrase_when_passphrase_kwarg_given( # noqa + self + ): + # Sanity: if we're given both fields, the password field is NOT used as + # a passphrase. +- self._test_connection( +- key_filename=_support("test_rsa_password.key"), +- password="television", +- passphrase="wat? lol no", +- ) ++ with pytest.raises(AuthenticationException): ++ self._test_connection( ++ key_filename=_support("test_rsa_password.key"), ++ password="television", ++ passphrase="wat? lol no", ++ ) diff --git a/srcpkgs/python3-paramiko/template b/srcpkgs/python3-paramiko/template index cff1b3a2fb59..67ffdbd9148d 100644 --- a/srcpkgs/python3-paramiko/template +++ b/srcpkgs/python3-paramiko/template @@ -1,14 +1,19 @@ # Template file for 'python3-paramiko' pkgname=python3-paramiko -version=2.7.2 -revision=2 +version=2.10.4 +revision=1 wrksrc="${pkgname#*-}-${version}" build_style=python3-module hostmakedepends="python3-setuptools" depends="python3-cryptography python3-pyasn1 python3-bcrypt python3-pynacl" +checkdepends="python3-pytest python3-mock $depends" short_desc="Python3 SSH2 protocol library" maintainer="Orphaned " license="LGPL-2.1-or-later" homepage="http://www.paramiko.org/" distfiles="${PYPI_SITE}/p/paramiko/paramiko-${version}.tar.gz" -checksum=7f36f4ba2c0d81d219f4595e35f70d56cc94f9ac40a6acdf51d6ca210ce65035 +checksum=3d2e650b6812ce6d160abff701d6ef4434ec97934b13e95cf1ad3da70ffb5c58 + +# post_extract() { +# rm paramiko/{_win,win_}* +# }