14
0
forked from pool/python-josepy

- Really run tests

- Disable docs building it is distributed by upstream and does not
  work on older openSUSE releases

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-josepy?expand=0&rev=9
This commit is contained in:
Tomáš Chvátal
2019-01-29 12:32:44 +00:00
committed by Git OBS Bridge
parent e0e224f08a
commit 1bd2027be5
2 changed files with 18 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-josepy
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,75 +12,50 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define libname josepy
%bcond_with test
Name: python-%{libname}
Version: 1.1.0
Release: 0
Summary: JOSE protocol implementation in Python
License: Apache-2.0
Group: Development/Languages/Python
Url: https://github.com/certbot/certbot
URL: https://github.com/certbot/josepy
Source0: https://files.pythonhosted.org/packages/source/j/%{libname}/%{libname}-%{version}.tar.gz
Source1: https://files.pythonhosted.org/packages/source/j/%{libname}/%{libname}-%{version}.tar.gz.asc
Source2: %{name}.keyring
BuildRequires: %{python_module coverage >= 4.0}
BuildRequires: %{python_module cryptography >= 0.8}
BuildRequires: %{python_module devel >= 2.7}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pyOpenSSL >= 0.13}
BuildRequires: %{python_module pytest >= 2.8.0}
BuildRequires: %{python_module setuptools >= 1.0}
BuildRequires: %{python_module six >= 1.9.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# for doc
BuildRequires: %{python_module Sphinx >= 1.0}
BuildRequires: %{python_module sphinx_rtd_theme}
%if %{with test}
BuildRequires: %{python_module coverage >= 4.0}
BuildRequires: %{python_module flake8}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest >= 2.8.0}
BuildRequires: %{python_module pytest-cache >= 1.0}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-flake8 >= 0.5}
BuildRequires: %{python_module pytest-isort}
%endif
Requires: python-cryptography >= 0.8
Requires: python-pyOpenSSL >= 0.13
Requires: python-six >= 1.5.2
Requires: python-six >= 1.9.0
Conflicts: python-acme < 0.21.0
Obsoletes: python-%{libname}-doc
BuildArch: noarch
%python_subpackages
%description
JOSE protocol implementation in Python using cryptography.
It is used by the certbot project. Formerly Let's Encrypt project.
%package -n python-%{libname}-doc
Summary: Documentation for python-josepy libraries
#Provides: %%{python_module %%{libname}-doc = %%{version}}
Group: Documentation/HTML
%description -n python-%{libname}-doc
Documentation for the JOSE protocol implementation libraries
%prep
%setup -q -n %{libname}-%{version}
rm pytest.ini
%build
%python_build
# create docs. Possible formats: man text html epub
pushd docs
make %{?_smp_mflags} html
rm -rf _build/html/{.buildinfo,man,_sources}
popd
%install
%python_install
@@ -92,25 +67,15 @@ popd
# remove duplicates
%python_expand %fdupes %{buildroot}%{$python_sitelib}/%{libname}
%if %{with test}
%check
# rise up errors. Find no fix.
%python_exec setup.py test
%endif
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} src/
%files %{python_files}
%defattr(-,root,root)
%doc LICENSE.txt
%license LICENSE.txt
%{python_sitelib}/%{libname}
%{python_sitelib}/%{libname}-%{version}*.egg-info
%pycache_only %{python_sitelib}/%{libname}/__pycache__
# following the certbot-packaging guide, "jws" should not be packaged
%exclude %{_bindir}/jws
%files -n python-%{libname}-doc
%defattr(-,root,root)
%doc LICENSE.txt
%doc README.rst
%doc docs/_build/html
%changelog