[packages/python3-josepy] - josepy 1.13 requires python 3.6+, so moved to python3-josepy.spec; added tests and apidocs
qboosh
qboosh at pld-linux.org
Wed Jan 25 06:30:02 CET 2023
commit 62d847d9ce1239c7daf9cf635eeaabfaa09cb036
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jan 25 06:30:58 2023 +0100
- josepy 1.13 requires python 3.6+, so moved to python3-josepy.spec; added tests and apidocs
python-josepy.spec | 75 -------------------------------------------
python3-josepy.spec | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+), 75 deletions(-)
---
diff --git a/python-josepy.spec b/python-josepy.spec
deleted file mode 100644
index 6bcdd36..0000000
--- a/python-josepy.spec
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Conditional build:
-%bcond_without python2 # Python 2.x module
-%bcond_without python3 # Python 3.x module
-#
-%define module josepy
-Summary: JOSE protocol implementation
-Name: python-%{module}
-Version: 1.13.0
-Release: 1
-License: Apache v2.0
-Group: Development/Languages/Python
-Source0: https://files.pythonhosted.org/packages/source/j/josepy/josepy-%{version}.tar.gz
-# Source0-md5: d0f8dc9ffbf3ce0bd9c40e5ec1bf3516
-URL: https://josepy.readthedocs.io/en/latest/
-%if %{with python2}
-BuildRequires: python-devel >= 1:2.6
-BuildRequires: python-setuptools
-%endif
-%if %{with python3}
-BuildRequires: python3-devel >= 1:3.2
-BuildRequires: python3-setuptools
-%endif
-BuildArch: noarch
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-This package provides JOSE protocol implementation.
-
-%package -n python3-%{module}
-Summary: JOSE protocol implementation in Python 3
-Group: Development/Languages/Python
-
-%description -n python3-%{module}
-This package provides JOSE protocol implementation in Python 3.
-
-%prep
-%setup -q -n %{module}-%{version}
-
-%build
-%if %{with python2}
-%py_build
-%endif
-%if %{with python3}
-%py3_build
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python3}
-%py3_install
-%endif
-
-%if %{with python2}
-%py_install
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/jws
-%{py_sitescriptdir}/josepy-*-py*.egg-info
-%{py_sitescriptdir}/josepy
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%{py3_sitescriptdir}/josepy-*-py*.egg-info
-%{py3_sitescriptdir}/josepy
-%endif
diff --git a/python3-josepy.spec b/python3-josepy.spec
new file mode 100644
index 0000000..f96e319
--- /dev/null
+++ b/python3-josepy.spec
@@ -0,0 +1,92 @@
+#
+# Conditional build:
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
+
+%define module josepy
+Summary: JOSE protocol implementation
+Summary(pl.UTF-8): Implementacja protokołu JOSE
+Name: python3-%{module}
+Version: 1.13.0
+Release: 2
+License: Apache v2.0
+Group: Development/Languages/Python
+Source0: https://files.pythonhosted.org/packages/source/j/josepy/josepy-%{version}.tar.gz
+# Source0-md5: d0f8dc9ffbf3ce0bd9c40e5ec1bf3516
+URL: https://josepy.readthedocs.io/en/latest/
+BuildRequires: python3-devel >= 1:3.6
+BuildRequires: python3-setuptools >= 1.0
+%if %{with tests}
+BuildRequires: python3-cryptography >= 1.5
+BuildRequires: python3-pyOpenSSL >= 0.13
+BuildRequires: python3-pytest >= 2.8.0
+BuildRequires: python3-pytest-cov
+%endif
+%if %{with doc}
+BuildRequires: python3-Sphinx >= 1.0
+BuildRequires: python3-cryptography >= 1.5
+BuildRequires: python3-pyOpenSSL >= 0.13
+BuildRequires: python3-sphinx_rtd_theme >= 1.0
+%endif
+Conflicts: python-josepy < 1.13.0-2
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package provides JOSE protocol implementation.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera implementację protokołu JOSE.
+
+%package apidocs
+Summary: API documentation for josepy module
+Summary(pl.UTF-8): Dokumentacja API modułu josepy
+Group: Documentation
+
+%description apidocs
+API documentation for josepy module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu josepy.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_cov.plugin" \
+PYTHONPATH=$(pwd)/src \
+%{__python3} -m pytest tests
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd)/src \
+%{__make} -C docs html \
+ SPHINXBUILD="%{__python3} -m sphinx"
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/jws{,-3}
+ln -sf jws-3 $RPM_BUILD_ROOT%{_bindir}/jws
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst README.rst
+%attr(755,root,root) %{_bindir}/jws
+%attr(755,root,root) %{_bindir}/jws-3
+%{py3_sitescriptdir}/josepy
+%{py3_sitescriptdir}/josepy-%{version}-py*.egg-info
+
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,api,man,*.html,*.js}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-josepy.git/commitdiff/62d847d9ce1239c7daf9cf635eeaabfaa09cb036
More information about the pld-cvs-commit
mailing list