diff --git a/disable-test_key_too_short.patch b/disable-test_key_too_short.patch deleted file mode 100644 index 56de01f..0000000 --- a/disable-test_key_too_short.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- tests/algorithms/test_EC.py.orig 2020-05-19 13:30:45.751510090 +0800 -+++ tests/algorithms/test_EC.py 2020-05-19 13:31:04.910669306 +0800 -@@ -113,6 +113,8 @@ - public_pem = key.public_key().to_pem() - assert ECKey(public_pem, ALGORITHMS.ES256).is_public() - -+ @pytest.mark.skip('Enable again when this test is fixed in upstream.') -+ # https://github.com/mpdavis/python-jose/issues/176 - @pytest.mark.parametrize("Backend,ExceptionType", _backend_exception_types()) - def test_key_too_short(self, Backend, ExceptionType): - key = Backend(TOO_SHORT_PRIVATE_KEY, ALGORITHMS.ES512) diff --git a/python-jose.spec b/python-jose.spec index 386bb7a..b194f58 100644 --- a/python-jose.spec +++ b/python-jose.spec @@ -4,15 +4,12 @@ Name: python-%{srcname} Version: 3.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: %{_summary} License: MIT URL: http://github.com/mpdavis/python-jose Source0: %{pypi_source %pypi_name} -# Due to version of ecdsa 0.15, which is available in YUM repo already -# https://github.com/mpdavis/python-jose/issues/176#issuecomment-642352816 -Patch0: disable-test_key_too_short.patch BuildArch: noarch BuildRequires: python3-devel @@ -99,9 +96,13 @@ Requires: python3dist(pycryptodomex) < 4.0.0 Please refer to the description of python3-%{srcname} %prep -%setup -q -n %{pypi_name}-%{version} -%patch0 -p0 -sed -i 's#ecdsa <0.15#ecdsa#' setup.py +%autosetup -n %{pypi_name}-%{version} + +# Upstream pinned ecdsa to an old version, 0.15.0, and considered it a “fix” to +# https://github.com/mpdavis/python-jose/issues/176, but of course we must work +# with whatever is in the repositories, even if things do not work perfectly. +# Unpin it. +sed -r -i 's/(ecdsa)[[:blank:]]*<[[:blank:]][[:alnum:].]+/\1/' setup.py rm -rf python_jose.egg-info @@ -112,28 +113,32 @@ rm -rf python_jose.egg-info %py3_install %check +# See https://github.com/mpdavis/python-jose/issues/176; the problem occurs +# even on ecdsa 0.16.1, so we must skip the test unconditionally. +k='not (TestECAlgorithm and test_key_too_short)' + # Test base -python3 -m pytest \ +python3 -m pytest -k "${k}" \ -m "not (cryptography or pycryptodome or pycrypto or backend_compatibility)" \ tests # Test the pyca/cryptography backend -python3 -m pytest \ +python3 -m pytest -k "${k}" \ -m "not (pycryptodome or pycrypto or backend_compatibility)" \ tests # Test the pycryptodome backend -python3 -m pytest \ +python3 -m pytest -k "${k}" \ -m "not (cryptography or pycrypto or backend_compatibility)" \ tests # Test the pycrypto backend -python3 -m pytest \ +python3 -m pytest -k "${k}" \ -m "not (cryptography or pycryptodome or backend_compatibility)" \ tests # Test cross-backend compatibility and coexistence -python3 -m pytest tests +python3 -m pytest -k "${k}" tests %files -n python3-%{srcname} %license LICENSE @@ -151,6 +156,9 @@ python3 -m pytest tests %doc README.rst %changelog +* Sat Feb 27 2021 Benjamin A. Beasley - 3.2.0-3 +- Change “test_key_too_short” skip from patch to pytest option + * Wed Jan 27 2021 Fedora Release Engineering - 3.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild