From d86c4ed4dbb74cc875bbb2b4d668f0d65a5485eb Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Jun 06 2021 12:44:08 +0000 Subject: Update to 3.3.0 (fixes RHBZ#1968095) - Drop python-jose-3.2.0-pr-199.patch (backported ecdsa 0.16 support), now merged upstream - Upstream dropped pycypto backend; we drop the corresponding extra - Remove a comment referring to Fedora 32 since it is EOL - Stop removing egg-info/dist-info (not needed with pyproject-rpm-macros --- diff --git a/.gitignore b/.gitignore index 0589b94..caad9d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /python-jose-3.1.0.tar.gz /python-jose-3.2.0.tar.gz +/python-jose-3.3.0.tar.gz diff --git a/python-jose-3.2.0-pr-199.patch b/python-jose-3.2.0-pr-199.patch deleted file mode 100644 index 8f5c7ff..0000000 --- a/python-jose-3.2.0-pr-199.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -Naur python-jose-3.2.0-original/jose/backends/ecdsa_backend.py python-jose-3.2.0/jose/backends/ecdsa_backend.py ---- python-jose-3.2.0-original/jose/backends/ecdsa_backend.py 2020-07-29 18:44:40.000000000 -0400 -+++ python-jose-3.2.0/jose/backends/ecdsa_backend.py 2021-03-05 08:44:34.128359807 -0500 -@@ -91,11 +91,22 @@ - return ecdsa.keys.VerifyingKey.from_public_point(point, self.curve) - - def sign(self, msg): -- return self.prepared_key.sign(msg, hashfunc=self.hash_alg, sigencode=ecdsa.util.sigencode_string) -+ return self.prepared_key.sign( -+ msg, -+ hashfunc=self.hash_alg, -+ sigencode=ecdsa.util.sigencode_string, -+ allow_truncate=False -+ ) - - def verify(self, msg, sig): - try: -- return self.prepared_key.verify(sig, msg, hashfunc=self.hash_alg, sigdecode=ecdsa.util.sigdecode_string) -+ return self.prepared_key.verify( -+ sig, -+ msg, -+ hashfunc=self.hash_alg, -+ sigdecode=ecdsa.util.sigdecode_string, -+ allow_truncate=False -+ ) - except Exception: - return False - -diff -Naur python-jose-3.2.0-original/requirements.txt python-jose-3.2.0/requirements.txt ---- python-jose-3.2.0-original/requirements.txt 2020-07-29 18:44:45.000000000 -0400 -+++ python-jose-3.2.0/requirements.txt 2021-03-05 08:51:54.636194256 -0500 -@@ -1,5 +1,5 @@ - pycryptodome - six - rsa --ecdsa<0.15 -+ecdsa != 0.15 - pyasn1 -diff -Naur python-jose-3.2.0-original/setup.py python-jose-3.2.0/setup.py ---- python-jose-3.2.0-original/setup.py 2020-07-29 18:46:23.000000000 -0400 -+++ python-jose-3.2.0/setup.py 2021-03-05 08:48:18.808805515 -0500 -@@ -38,7 +38,7 @@ - 'pycrypto': ['pycrypto >=2.6.0, <2.7.0'] + pyasn1, - 'pycryptodome': ['pycryptodome >=3.3.1, <4.0.0'] + pyasn1, - } --legacy_backend_requires = ['ecdsa <0.15', 'rsa'] + pyasn1 -+legacy_backend_requires = ['ecdsa != 0.15', 'rsa'] + pyasn1 - install_requires = ['six <2.0'] - - # TODO: work this into the extras selection instead. -@@ -76,7 +76,7 @@ - ], - tests_require=[ - 'six', -- 'ecdsa', -+ 'ecdsa != 0.15', - 'pytest', - 'pytest-cov', - 'pytest-runner', diff --git a/python-jose.spec b/python-jose.spec index b1bfef3..b33ef90 100644 --- a/python-jose.spec +++ b/python-jose.spec @@ -2,8 +2,8 @@ %global _summary JOSE implementation in Python Name: python-%{srcname} -Version: 3.2.0 -Release: 7%{?dist} +Version: 3.3.0 +Release: 1%{?dist} Summary: A JOSE implementation in Python License: MIT @@ -11,10 +11,6 @@ URL: https://github.com/mpdavis/%{name} Source0: %{pypi_source %{name}} BuildArch: noarch -# Upstream support for ecdsa >= 0.16 -# https://github.com/mpdavis/python-jose/pull/199 -Patch0: %{name}-3.2.0-pr-199.patch - BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # From setup_requires: @@ -38,6 +34,13 @@ BuildRequires: python3dist(sphinx) Obsoletes: python3-%{srcname}-pycryptodome < 3.2.0-3 %endif +# Upstream release 3.3.0, first packaged in Fedora 35, dropped the pycrypto +# backend, so we obsolete the corresponding extra. The conditional reminds us +# when the Obsoletes can be removed from the spec file. +%if 0%{?fedora} != 0 && 0%{?fedora} < 38 +Obsoletes: python3-%{srcname}+pycrypto < 3.3.0-1 +%endif + # Upstream recommends the cryptography backend. We add it as a soft dependency # so that anyone who does not go out of their way to select a different backend # gets the best experience. @@ -51,7 +54,7 @@ using a variety of algorithms. While the full set of permutations is extremely large, and might be daunting to some, it is expected that most applications will only use a small set of algorithms to meet their needs. -As of 3.1.0, python-jose implements four different cryptographic backends. The +As of 3.3.0, python-jose implements three different cryptographic backends. The backend must be selected as an extra when installing python-jose. If you do not select a backend, the native-python backend will be installed. @@ -85,25 +88,13 @@ installed, even if you select a different backend on install. Note - The native-python backend cannot process certificates. - - 4. pycrypto - * This backend uses pycrypto for all cryptographic operations. - * Installation: dnf install python3-jose+pycrypto - * Unused dependencies: - - rsa - - Warning - - The pycrypto project has not been maintained since 2013. This backend is - maintained for legacy compatibility purposes only. Do not use this backend - unless you cannot use any of the others.} + The native-python backend cannot process certificates.} %description %{common_description} %generate_buildrequires -%pyproject_buildrequires -t -x cryptography,pycrypto +%pyproject_buildrequires -t -x cryptography %package -n python3-%{srcname} @@ -121,15 +112,9 @@ Summary: Documentation for %{name} # We use the expansion of (on a single line): # # %%python_extras_subpkg -n python3-%%{srcname} -# -i %%{python3_sitelib}/*.dist-info -# cryptography pycrypto -# -# macro, but add Provides/Obsoletes for the old backend subpackages. +# -i %%{python3_sitelib}/*.dist-info cryptography # -# Even though Fedora 32 does not have -# https://fedoraproject.org/wiki/Changes/PythonExtras, these metapackages will -# still work; they just will not provide python3dist(python-jose[*]), and they -# need manual Requires. +# but add Provides/Obsoletes for the old backend subpackages. %package -n python3-%{srcname}+cryptography @@ -150,28 +135,9 @@ It contains no code, just makes sure the dependencies are installed. %ghost %{python3_sitelib}/*.dist-info -%package -n python3-%{srcname}+pycrypto -Summary: Metapackage for python3-%{srcname}: pycrypto extras - -Requires: python3-%{srcname} = %{version}-%{release} -%if 0%{?fedora} != 0 && 0%{?fedora} < 38 -Provides: python3-%{srcname}-pycrypto = %{version}-%{release} -Obsoletes: python3-%{srcname}-pycrypto < 3.2.0-3 -%endif - -%description -n python3-%{srcname}+pycrypto -This is a metapackage bringing in pycrypto extras requires for python3-%{srcname}. -It contains no code, just makes sure the dependencies are installed. - -%files -n python3-%{srcname}+pycrypto -%ghost %{python3_sitelib}/*.dist-info - - %prep %autosetup -p1 -rm -rvf *.egg-info *.dist-info - # Patch out pycryptodome backend extra and tests where required; see note near # the BR’s sed -r -i '/^[[:blank:]]*pycryptodome/d' tox.ini requirements.txt @@ -194,15 +160,11 @@ rm -vf docs/_build/html/.buildinfo %check echo '>>> Backend: native-python <<<' 1>&2 -m='not (cryptography or pycryptodome or pycrypto or backend_compatibility)' +m='not (cryptography or pycryptodome or backend_compatibility)' %{pytest} -k "${k}" -m "${m}" tests echo '>>> Backend: cryptography <<<' 1>&2 -m='not (pycryptodome or pycrypto or backend_compatibility)' -%{pytest} -k "${k}" -m "${m}" tests - -echo '>>> Backend: pycrypto <<<' 1>&2 -m='not (cryptography or pycryptodome or backend_compatibility)' +m='not (pycryptodome or backend_compatibility)' %{pytest} -k "${k}" -m "${m}" tests echo '>>> Cross-backend compatibility and coexistence <<<' 1>&2 @@ -220,6 +182,14 @@ echo '>>> Cross-backend compatibility and coexistence <<<' 1>&2 %changelog +* Sun Jun 06 2021 Benjamin A. Beasley - 3.3.0-1 +- Update to 3.3.0 (fixes RHBZ#1968095) +- Drop python-jose-3.2.0-pr-199.patch (backported ecdsa 0.16 support), now + merged upstream +- Upstream dropped pycypto backend; we drop the corresponding extra +- Remove a comment referring to Fedora 32 since it is EOL +- Stop removing egg-info/dist-info (not needed with pyproject-rpm-macros + * Fri Jun 04 2021 Python Maint - 3.2.0-7 - Rebuilt for Python 3.10 diff --git a/sources b/sources index 0487414..00eb918 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-jose-3.2.0.tar.gz) = 139d29ca800003c593562921dd9ab7b5449c0b0ac9aad8124355c28a94e9169c310a6b26f6d03cd88671713207ca3edeb8282b56239af003ea2b7f7d9df923f1 +SHA512 (python-jose-3.3.0.tar.gz) = bfa86123b304923cb1255d075055260b9889cabaa86f868d69e1e2d9fc8f41ab2390ca0a9f3f60afbbedfa0929b5f96f47fbb2d9fc8fc665459292a41f3654de