#1 Update to 3.3.0 (fixes RHBZ#1968095)
Merged 2 years ago by music. Opened 2 years ago by music.
rpms/ music/python-jose v3.3.0  into  rawhide

file modified
+1
@@ -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

@@ -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',

file modified
+24 -54
@@ -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 @@ 

  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 @@ 

  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 @@ 

  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 @@ 

  

       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 @@ 

  # 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 @@ 

  %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 @@ 

  

  %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 @@ 

  

  

  %changelog

+ * Sun Jun 06 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 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 <python-maint@redhat.com> - 3.2.0-7

  - Rebuilt for Python 3.10

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (python-jose-3.2.0.tar.gz) = 139d29ca800003c593562921dd9ab7b5449c0b0ac9aad8124355c28a94e9169c310a6b26f6d03cd88671713207ca3edeb8282b56239af003ea2b7f7d9df923f1

+ SHA512 (python-jose-3.3.0.tar.gz) = bfa86123b304923cb1255d075055260b9889cabaa86f868d69e1e2d9fc8f41ab2390ca0a9f3f60afbbedfa0929b5f96f47fbb2d9fc8fc665459292a41f3654de

  • 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

Merge after Python 3.10 mass rebuild is complete (or merge and build manually into f35-python side tag). No update for F33/F34.

Pull-Request has been merged by music

2 years ago