diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51cc766 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/josepy-1.0.1.tar.gz +/josepy-1.1.0.tar.gz +/josepy-1.2.0.tar.gz diff --git a/0000-ignore-missing-linters.patch b/0000-ignore-missing-linters.patch new file mode 100644 index 0000000..a039b58 --- /dev/null +++ b/0000-ignore-missing-linters.patch @@ -0,0 +1,26 @@ +diff --git a/pytest.ini b/pytest.ini +index 0c00f0f0..05d13131 100644 +--- a/pytest.ini ++++ b/pytest.ini +@@ -1,4 +1,4 @@ + [pytest] +-addopts = -v --flake8 --cov-report xml --cov-report=term-missing --cov=josepy --cov-config .coveragerc ++addopts = -v + norecursedirs = *.egg .eggs dist build docs .tox + flake8-ignore = W504 E501 +diff --git a/setup.py b/setup.py +index 18a14344..cd598749 100644 +--- a/setup.py ++++ b/setup.py +@@ -20,11 +20,6 @@ install_requires = [ + ] + + testing_requires = [ +- 'coverage>=4.0', +- 'pytest-cache>=1.0', +- 'pytest-cov', +- 'flake8', +- 'pytest-flake8>=0.5', + 'pytest>=2.8.0', + 'mock', + ] diff --git a/0001-allow-old-versions.patch b/0001-allow-old-versions.patch new file mode 100644 index 0000000..f1b9984 --- /dev/null +++ b/0001-allow-old-versions.patch @@ -0,0 +1,21 @@ +diff --git a/setup.py b/setup.py +index cd598749..9bc72d92 100644 +--- a/setup.py ++++ b/setup.py +@@ -13,14 +13,12 @@ install_requires = [ + 'cryptography>=0.8', + # Connection.set_tlsext_host_name (>=0.13) + 'PyOpenSSL>=0.13', +- # For pkg_resources. >=1.0 so pip resolves it to a version cryptography +- # will tolerate; see #2599: +- 'setuptools>=1.0', ++ 'setuptools', + 'six>=1.9.0', # needed for python_2_unicode_compatible + ] + + testing_requires = [ +- 'pytest>=2.8.0', ++ 'pytest', + 'mock', + ] + diff --git a/README.md b/README.md deleted file mode 100644 index 7ed868e..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-josepy - -The python-josepy package \ No newline at end of file diff --git a/python-josepy.spec b/python-josepy.spec new file mode 100644 index 0000000..cfee6d0 --- /dev/null +++ b/python-josepy.spec @@ -0,0 +1,246 @@ +%global pypi_name josepy + +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 +%bcond_with docs +%else +%bcond_without python3 +%bcond_without docs +%endif + +%if 0%{?fedora} >= 30 || 0%{?rhel} >= 8 +%bcond_with python2 +%else +%bcond_without python2 +%endif + +Name: python-%{pypi_name} +Version: 1.2.0 +Release: 5%{?dist} +Summary: JOSE protocol implementation in Python + +License: ASL 2.0 +URL: https://pypi.python.org/pypi/josepy +Source0: https://files.pythonhosted.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +BuildArch: noarch + +# Remove various unpackaged testing dependencies that are used only for linting +Patch0: 0000-ignore-missing-linters.patch + +%if 0%{?rhel} && 0%{?rhel} <= 7 +Patch1: 0001-allow-old-versions.patch +%endif + +%if %{with python2} +BuildRequires: python2-devel +BuildRequires: python2-mock +BuildRequires: python2-pytest +BuildRequires: python2-setuptools +%endif + +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-mock +BuildRequires: python3-pytest +BuildRequires: python3-setuptools + +%if 0%{?fedora} +# EL8 doesn't currently have this package, which is used during testing +BuildRequires: python3-mypy +%endif +%endif + +%if %{with docs} +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme +%endif + +%description +JOSE protocol implementation in Python using cryptography. + +%if %{with python2} +%package -n python2-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{pypi_name}} + +Requires: python2-cryptography +Requires: python2-setuptools +Requires: python2-six +BuildRequires: python2-cryptography +BuildRequires: python2-setuptools +BuildRequires: python2-six +%if 0%{?rhel} && 0%{?rhel} <= 7 +# EL7 has an unversioned name for this package +Requires: pyOpenSSL +BuildRequires: pyOpenSSL +%else +Requires: python2-pyOpenSSL +BuildRequires: python2-pyOpenSSL +%endif + +%if %{with docs} && !(0%{?rhel} && 0%{?rhel} <= 7) +Recommends: python-%{pypi_name}-doc +%endif + +%description -n python2-%{pypi_name} +JOSE protocol implementation in Python using cryptography. + +This is the Python 2 version of the package. +%endif + +%if %{with python3} +%package -n python3-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: python3-cryptography +Requires: python3-pyOpenSSL +Requires: python3-setuptools +Requires: python3-six +BuildRequires: python3-cryptography +BuildRequires: python3-pyOpenSSL +BuildRequires: python3-setuptools +BuildRequires: python3-six + +%if %{with docs} && !(0%{?rhel} && 0%{?rhel} <= 7) +Recommends: python-%{pypi_name}-doc +%endif + +%description -n python3-%{pypi_name} +JOSE protocol implementation in Python using cryptography. + +This is the Python 3 version of the package. +%endif + +%if %{with docs} +%package -n python-%{pypi_name}-doc +Summary: Documentation for python-%{pypi_name} +Conflicts: python2-%{pypi_name} < 1.1.0-9 +Conflicts: python3-%{pypi_name} < 1.1.0-9 +%description -n python-%{pypi_name}-doc +Documentation for python-%{pypi_name} +%endif + +%prep +%autosetup -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + +%build +%if %{with python2} +%py2_build +%endif + +%if %{with python3} +%py3_build +%endif + +# Build documentation +%if %{with docs} +# EL7 has problems building the documentation due to fontawesome-fonts-web only +# being available on x86_64 +%{__python3} setup.py install --user +make -C docs man PATH=${HOME}/.local/bin:$PATH SPHINXBUILD=sphinx-build-3 +%endif + +%install +%if %{with python2} +%py2_install +%endif + +%if %{with python3} +%py3_install +%endif + +%if %{with docs} +install -Dpm0644 -t %{buildroot}%{_mandir}/man1 docs/_build/man/*.1* +%endif + +%check +%if %{with python2} +%{__python2} setup.py test +%endif + +%if %{with python3} +%{__python3} setup.py test +%endif + +%if %{with python2} +%files -n python2-%{pypi_name} +%license LICENSE.txt +%doc README.rst +%{python2_sitelib}/josepy +%{python2_sitelib}/josepy-%{version}-py?.?.egg-info +%if ! %{with python3} +%{_bindir}/jws +%else +%exclude %{_mandir}/man1/jws.1* +%endif +%endif + +%if %{with python3} +%files -n python3-%{pypi_name} +%license LICENSE.txt +%doc README.rst +%{python3_sitelib}/josepy +%{python3_sitelib}/josepy-%{version}-py?.?.egg-info +%{_bindir}/jws +%endif + +%if %{with docs} +%files -n python-%{pypi_name}-doc +%license LICENSE.txt +%doc README.rst +%{_mandir}/man1/* +%endif + +%changelog +* Mon Oct 07 2019 Eli Young - 1.2.0-5 +- Support EPEL8 builds + +* Thu Oct 03 2019 Miro Hrončok - 1.2.0-4 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 1.2.0-3 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Jul 01 2019 Eli Young - 1.2.0-1 +- Update to 1.2.0 (#1725899) + +* Thu Jun 27 2019 Eli Young - 1.1.0-9 +- Split docs to separate package (#1700273) + +* Sat Feb 02 2019 Fedora Release Engineering - 1.1.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Dec 13 2018 Eli Young - 1.1.0-7 +- Remove Python 2 package in Fedora 30+ (#1658534) + +* Sat Jul 14 2018 Fedora Release Engineering - 1.1.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jul 02 2018 Eli Young - 1.1.0-5 +- Enable tests + +* Mon Jul 02 2018 Miro Hrončok - 1.1.0-4 +- Rebuilt for Python 3.7 + +* Fri Jun 29 2018 Eli Young - 1.1.0-3 +- Use available python2 metapackages for EPEL7 +- Specify binary name for sphinx-build +- Fix permissions on man files + +* Tue Jun 19 2018 Miro Hrončok - 1.1.0-2 +- Rebuilt for Python 3.7 + +* Tue Apr 17 2018 Eli Young - 1.1.0-1 +- Update to 1.1.0 (#1567455) + +* Fri Feb 09 2018 Fedora Release Engineering - 1.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 18 2018 Eli Young - 1.0.1-1 +- Initial package. diff --git a/sources b/sources new file mode 100644 index 0000000..04b7343 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (josepy-1.2.0.tar.gz) = 1e746cf8e02c86a728d1a502000bba3c7db829f29dcb49ed40c7398d2ec904e830d267c60b444d57c3cf44d6ae829d3f3f4fd4288dcb3d5f47ab96d06a2d6bc5