Accepting request 979755 from home:bnavigator:branches:devel:languages:python

- Update to 3.3.0
  * Remove support for python 2.7 & 3.5
  * Add support for Python 3.9
  * Remove PyCrypto backend
  * Fix deprecation warning from cryptography backend
- Add rpm subpackages for the extra backend selection.  The missing
  requires were only discovered because other packages started to
  fail.
  * setup.py and README still mention pycrypto and pycryptodome, but
    it was removed from the code.
  * Test in flavors
- Refresh unpin-deps.patch

OBS-URL: https://build.opensuse.org/request/show/979755
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jose?expand=0&rev=9
This commit is contained in:
Matej Cepl 2022-05-29 20:52:04 +00:00 committed by Git OBS Bridge
parent ae214757e3
commit 930eaed495
6 changed files with 122 additions and 41 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<flavor>test-backend-cryptography</flavor>
<flavor>test-backend-native</flavor>
</multibuild>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2bcdae15bef4bc22c35edae9bda0fec1c42769e96cef680c76e165ac5bbf3cd5
size 102183

BIN
python-jose-3.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Sun May 29 19:45:02 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update to 3.3.0
* Remove support for python 2.7 & 3.5
* Add support for Python 3.9
* Remove PyCrypto backend
* Fix deprecation warning from cryptography backend
- Add rpm subpackages for the extra backend selection. The missing
requires were only discovered because other packages started to
fail.
* setup.py and README still mention pycrypto and pycryptodome, but
it was removed from the code.
* Test in flavors
- Refresh unpin-deps.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 5 12:58:25 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com> Wed Aug 5 12:58:25 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-python-jose # spec file
# #
# Copyright (c) 2020 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,29 +16,52 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %global flavor @BUILD_FLAVOR@%{nil}
Name: python-python-jose %if "%{flavor}" == "test-backend-cryptography"
Version: 3.2.0 %define psuffix -%{flavor}
%bcond_without test
%bcond_without testcryptography
%bcond_with testnative
%endif
%if "%{flavor}" == "test-backend-native"
%define psuffix -%{flavor}
%bcond_without test
%bcond_with testcryptography
%bcond_without testnative
%endif
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
%bcond_with testcryptography
%bcond_with testnative
%endif
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-python-jose%{psuffix}
Version: 3.3.0
Release: 0 Release: 0
Summary: JOSE implementation in Python Summary: JOSE implementation in Python
License: MIT License: MIT
URL: https://github.com/mpdavis/python-jose URL: https://github.com/mpdavis/python-jose
Source: https://github.com/mpdavis/python-jose/archive/%{version}.tar.gz#/python-jose-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/p/python-jose/python-jose-%{version}.tar.gz
Patch0: unpin-deps.patch Patch0: unpin-deps.patch
BuildRequires: %{python_module setuptools >= 39.2.0} BuildRequires: %{python_module setuptools >= 39.2.0}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-six Requires: python-ecdsa >= 0.16
Recommends: python-cryptography Requires: python-pyasn1
Recommends: python-pyasn1 Requires: python-rsa
Recommends: python-pycryptodome >= 3.3.1
BuildArch: noarch BuildArch: noarch
# SECTION test requirements %if %{with test}
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module pyasn1}
BuildRequires: %{python_module pycryptodome >= 3.3.1}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module six} %if %{with testcryptography}
BuildRequires: %{python_module python-jose-cryptography = %{version}}
%endif
%if %{with testnative}
BuildRequires: %{python_module python-jose = %{version}}
%endif
%endif
# /SECTION # /SECTION
%python_subpackages %python_subpackages
@ -46,25 +69,51 @@ BuildRequires: %{python_module six}
A JavaScript Object Signing and Encryption (JOSE) technologies A JavaScript Object Signing and Encryption (JOSE) technologies
implementation in Python. implementation in Python.
%prep python-jose implements different cryptographic backends.
%setup -q -n python-jose-%{version} Consuming python packages must select the backend as an extra
%patch0 -p1 when installing python-jose. RPM packages must select the
sed -i -e '/addopts/d' setup.cfg corresponding rpm subpackage. If no backend is selected, the
sed -i -e '/pytest-runner/d' setup.py main package uses the native-python backend.
%package cryptography
Summary: JOSE implementation in Python, cryptography extra
Requires: %{name} = %{version}-%{release}
Requires: python-cryptography >= 3.4.0
%description cryptography
A JavaScript Object Signing and Encryption (JOSE) technologies
implementation in Python.
python-jose implements three different cryptographic backends.
This package provides the python-jose[cryptography] extra.
%prep
%autosetup -p1 -n python-jose-%{version}
%if ! %{with test}
%build %build
%python_build %python_build
%install %install
%python_install %python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check %check
%pytest %pytest -rsEf
%endif
%if ! %{with test}
%files %{python_files} %files %{python_files}
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
%{python_sitelib}/* %{python_sitelib}/python_jose-%{version}*-info
%{python_sitelib}/jose
%files %{python_files cryptography}
%doc README.rst
%license LICENSE
%endif
%changelog %changelog

View File

@ -1,20 +1,32 @@
Index: python-jose-3.2.0/setup.py Index: python-jose-3.3.0/setup.py
=================================================================== ===================================================================
--- python-jose-3.2.0.orig/setup.py --- python-jose-3.3.0.orig/setup.py
+++ python-jose-3.2.0/setup.py +++ python-jose-3.3.0/setup.py
@@ -35,11 +35,11 @@ def _cryptography_version(): @@ -23,11 +23,9 @@ def get_packages(package):
pyasn1 = ['pyasn1'] pyasn1 = ["pyasn1"]
extras_require = { extras_require = {
'cryptography': [_cryptography_version()], "cryptography": ["cryptography>=3.4.0"],
- 'pycrypto': ['pycrypto >=2.6.0, <2.7.0'] + pyasn1, - "pycrypto": ["pycrypto >=2.6.0, <2.7.0"] + pyasn1,
- 'pycryptodome': ['pycryptodome >=3.3.1, <4.0.0'] + pyasn1, - "pycryptodome": ["pycryptodome >=3.3.1, <4.0.0"] + pyasn1,
+ 'pycrypto': ['pycrypto >=2.6.0'] + pyasn1,
+ 'pycryptodome': ['pycryptodome >=3.3.1'] + pyasn1,
} }
-legacy_backend_requires = ['ecdsa <0.15', 'rsa'] + pyasn1
-install_requires = ['six <2.0']
+legacy_backend_requires = ['ecdsa', 'rsa'] + pyasn1
+install_requires = ['six']
# TODO: work this into the extras selection instead. # TODO: work this into the extras selection instead.
install_requires += legacy_backend_requires -install_requires = ["ecdsa != 0.15", "rsa"] + pyasn1
+install_requires = ["ecdsa >= 0.16", "rsa"] + pyasn1
setup(
@@ -63,14 +61,11 @@ setup(
],
extras_require=extras_require,
setup_requires=[
- "pytest-runner",
"setuptools>=39.2.0",
],
tests_require=[
"ecdsa != 0.15",
"pytest",
- "pytest-cov",
- "pytest-runner",
],
install_requires=install_requires,
)