[packages/python3-pyjwt] - updated to 2.0.1 (for python 3.6+) as python3-pyjwt.spec - tests have pytest>=6.0.0 dependency, bu

qboosh qboosh at pld-linux.org
Thu Jan 21 18:17:44 CET 2021


commit 833b8f1bed5c35bab4095eee2f066a8f6169ac33
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Jan 21 18:17:54 2021 +0100

    - updated to 2.0.1 (for python 3.6+) as python3-pyjwt.spec
    - tests have pytest>=6.0.0 dependency, but pass also with pytest 5.4.x

 python-pyjwt-tests.patch |  29 -----------
 python-pyjwt.spec        | 122 -----------------------------------------------
 python3-pyjwt.spec       |  90 ++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+), 151 deletions(-)
---
diff --git a/python-pyjwt.spec b/python-pyjwt.spec
deleted file mode 100644
index bb27cb1..0000000
--- a/python-pyjwt.spec
+++ /dev/null
@@ -1,122 +0,0 @@
-#
-# Conditional build:
-%bcond_with	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-%define		module	pyjwt
-Summary:	JSON Web Token implementation in Python 2
-Summary(pl.UTF-8):	Implementacja JSON Web Token w Pythonie 2
-Name:		python-%{module}
-# keep 1.x here for python2 support
-Version:	1.7.1
-Release:	1
-License:	MIT
-Group:		Libraries/Python
-#Source0Download: https://pypi.org/simple/pyjwt/
-Source0:	https://files.pythonhosted.org/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz
-# Source0-md5:	a4712f980c008696e13e09504120b2a0
-Patch0:		%{name}-tests.patch
-URL:		http://github.com/jpadilla/pyjwt
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools
-%if %{with tests}
-BuildRequires:	python-Crypto
-BuildRequires:	python-ecdsa
-BuildRequires:	python-pytest >= 4.0.1
-BuildRequires:	python-pytest-cov >= 2.6.0
-BuildRequires:	python-pytest-runner >= 4.2
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-modules >= 1:3.4
-BuildRequires:	python3-setuptools
-%if %{with tests}
-BuildRequires:	python3-Crypto
-BuildRequires:	python3-ecdsa
-BuildRequires:	python3-pytest >= 4.0.1
-BuildRequires:	python3-pytest-cov >= 2.6.0
-BuildRequires:	python3-pytest-runner >= 4.2
-%endif
-%endif
-# file and namespace conflict
-Conflicts:	python-jwt
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-A Python implementation of RFC 7519. Original implementation was
-written by @progrium.
-
-%description -l pl.UTF-8
-Pythonowa implementacja RFC 7519. Oryginalna implementacja została
-napisana przez @progrium.
-
-%package -n python3-%{module}
-Summary:	JSON Web Token implementation in Python 3
-Summary(pl.UTF-8):	Implementacja JSON Web Token w Pythonie 3
-Group:		Libraries/Python
-Requires:	python3-setuptools
-# file and namespace conflict
-Conflicts:	python3-jwt
-
-%description -n python3-%{module}
-A Python implementation of RFC 7519. Original implementation was
-written by @progrium.
-
-%description -n python3-%{module} -l pl.UTF-8
-Pythonowa implementacja RFC 7519. Oryginalna implementacja została
-napisana przez @progrium.
-
-%prep
-%setup -q -n PyJWT-%{version}
-%patch0 -p1
-
-# Remove bundled egg-info
-%{__rm} -r PyJWT.egg-info
-
-%build
-%if %{with python2}
-%py_build %{?with_tests:pytest}
-%endif
-
-%if %{with python3}
-%py3_build %{?with_tests:pytest}
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
-%py_install
-%py_postclean
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/pyjwt{,-2}
-%endif
-
-%if %{with python3}
-%py3_install
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/pyjwt{,-3}
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc AUTHORS CHANGELOG.md LICENSE README.rst
-%attr(755,root,root) %{_bindir}/pyjwt-2
-%{py_sitescriptdir}/jwt
-%{py_sitescriptdir}/PyJWT-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc AUTHORS CHANGELOG.md LICENSE README.rst
-%attr(755,root,root) %{_bindir}/pyjwt-3
-%{py3_sitescriptdir}/jwt
-%{py3_sitescriptdir}/PyJWT-%{version}-py*.egg-info
-%endif
diff --git a/python3-pyjwt.spec b/python3-pyjwt.spec
new file mode 100644
index 0000000..5eae9a6
--- /dev/null
+++ b/python3-pyjwt.spec
@@ -0,0 +1,90 @@
+#
+# Conditional build:
+%bcond_without	doc	# API documentation
+%bcond_with	tests	# unit tests
+
+%define		module	pyjwt
+Summary:	JSON Web Token implementation in Python 3
+Summary(pl.UTF-8):	Implementacja JSON Web Token w Pythonie 3
+Name:		python3-%{module}
+Version:	2.0.1
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/pyjwt/
+Source0:	https://files.pythonhosted.org/packages/source/P/PyJWT/PyJWT-%{version}.tar.gz
+# Source0-md5:	93b74f59d08be8c852a3c259da2ea121
+URL:		http://github.com/jpadilla/pyjwt
+BuildRequires:	python3-modules >= 1:3.6
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-cryptography >= 3.3.1
+BuildRequires:	python3-pytest >= 5.0.0
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python3-sphinx_rtd_theme
+BuildRequires:	sphinx-pdg-3
+%endif
+# file and namespace conflict
+Conflicts:	python3-jwt
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A Python implementation of RFC 7519. Original implementation was
+written by @progrium.
+
+%description -l pl.UTF-8
+Pythonowa implementacja RFC 7519. Oryginalna implementacja została
+napisana przez @progrium.
+
+%package apidocs
+Summary:	API documentation for PyJWT
+Summary(pl.UTF-8):	Dokumentacja API moduły PyJWT
+Group:		Documentation
+
+%description apidocs
+API documentation for PyJWT.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API moduły PyJWT.
+
+%prep
+%setup -q -n PyJWT-%{version}
+
+# Remove bundled egg-info
+%{__rm} -r PyJWT.egg-info
+
+%build
+%py3_build
+
+%if %{with tests}
+%{__python3} -m pytest tests
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
+%{py3_sitescriptdir}/jwt
+%{py3_sitescriptdir}/PyJWT-%{version}-py*.egg-info
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/python-pyjwt-tests.patch b/python-pyjwt-tests.patch
deleted file mode 100644
index d12fca0..0000000
--- a/python-pyjwt-tests.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- PyJWT-1.7.1/setup.py.orig	2018-12-06 13:28:35.000000000 +0100
-+++ PyJWT-1.7.1/setup.py	2021-01-20 21:48:02.372776650 +0100
-@@ -33,9 +33,9 @@
-     sys.exit()
- 
- tests_require = [
--    'pytest>=4.0.1,<5.0.0',
--    'pytest-cov>=2.6.0,<3.0.0',
--    'pytest-runner>=4.2,<5.0.0',
-+    'pytest>=4.0.1',
-+    'pytest-cov>=2.6.0',
-+    'pytest-runner>=4.2',
- ]
- 
- needs_pytest = set(('pytest', 'test', 'ptr')).intersection(sys.argv)
---- PyJWT-1.7.1/tests/contrib/test_algorithms.py.orig	2018-11-26 04:04:17.000000000 +0100
-+++ PyJWT-1.7.1/tests/contrib/test_algorithms.py	2021-01-20 21:47:38.742904664 +0100
-@@ -161,7 +161,10 @@
-         with open(key_path('testkey_ec.pub'), 'r') as keyfile:
-             jwt_pub_key = algo.prepare_key(keyfile.read())
- 
--        result = algo.verify(jwt_message, jwt_pub_key, jwt_sig)
-+        try:
-+            result = algo.verify(jwt_message, jwt_pub_key, jwt_sig)
-+        except: # ecdsa>=0.14 raises BadSignatureError
-+            result = False
-         assert not result
- 
-     def test_ec_verify_should_return_true_if_signature_valid(self):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-pyjwt.git/commitdiff/833b8f1bed5c35bab4095eee2f066a8f6169ac33



More information about the pld-cvs-commit mailing list