[packages/python-vine] - pl, fixed doc and tests
qboosh
qboosh at pld-linux.org
Sun Jan 31 14:42:08 CET 2021
commit 1d3672260f39b13fe253cdd3ed91000855998e20
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Jan 31 14:41:56 2021 +0100
- pl, fixed doc and tests
python-vine.spec | 80 ++++++++++++++++++++++++++++++++++++++++----------------
1 file changed, 57 insertions(+), 23 deletions(-)
---
diff --git a/python-vine.spec b/python-vine.spec
index 9556527..60a010a 100644
--- a/python-vine.spec
+++ b/python-vine.spec
@@ -1,7 +1,7 @@
#
# Conditional build:
-%bcond_with doc # build doc (broken)
-%bcond_with tests # do perform tests (extra deps pulled)
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
@@ -9,73 +9,107 @@
%define egg_name vine
%define pypi_name vine
Summary: Python promises
+Summary(pl.UTF-8): Obietnice dla Pythona
Name: python-%{module}
+# keep 1.x here for python2 support
Version: 1.3.0
Release: 1
License: BSD
Group: Libraries/Python
-# Source0: https://files.pythonhosted.org/packages/source/v/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
-Source0: https://pypi.debian.net/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
+Source0: https://files.pythonhosted.org/packages/source/v/vine/%{pypi_name}-%{version}.tar.gz
# Source0-md5: 5d125e0b4d759b39e03d11902dede8c9
-URL: https://vine.readthedocs.io/en/latest/
+URL: https://vine.readthedocs.io/
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
-BuildRequires: python-modules
-BuildRequires: python-setuptools
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools >= 20.6.7
+%if %{with tests}
+BuildRequires: python-case >= 1.3.1
+BuildRequires: python-pytest >= 3.0
+%endif
%endif
%if %{with python3}
-BuildRequires: python3-modules
-BuildRequires: python3-setuptools
+BuildRequires: python3-modules >= 1:3.4
+BuildRequires: python3-setuptools >= 20.6.7
+%if %{with tests}
+BuildRequires: python3-case >= 1.3.1
+BuildRequires: python3-pytest >= 3.0
+%endif
+%endif
+%if %{with doc}
+BuildRequires: sphinx-pdg-3
+BuildRequires: python3-sphinx_celery >= 1.1
%endif
-Requires: python-modules
+Requires: python-modules >= 1:2.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Python promises.
+%description -l pl.UTF-8
+Obietnice (promise) dla Pythona.
+
%package -n python3-%{module}
Summary: Python promises
+Summary(pl.UTF-8): Obietnice dla Pythona
Group: Libraries/Python
-Requires: python3-modules
+Requires: python3-modules >= 1:3.4
%description -n python3-%{module}
Python promises.
+%description -n python3-%{module} -l pl.UTF-8
+Obietnice (promise) dla Pythona.
+
%package apidocs
-Summary: %{module} API documentation
-Summary(pl.UTF-8): Dokumentacja API %{module}
+Summary: API documentation for vine module
+Summary(pl.UTF-8): Dokumentacja API modułu vine
Group: Documentation
%description apidocs
-API documentation for %{module}.
+API documentation for vine module.
%description apidocs -l pl.UTF-8
-Dokumentacja API %{module}.
+Dokumentacja API modułu vine.
%prep
%setup -q -n %{pypi_name}-%{version}
%build
%if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="case.pytest" \
+%{__python} -m pytest t/unit
+%endif
%endif
%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="case.pytest" \
+%{__python3} -m pytest t/unit
+%endif
%endif
%if %{with doc}
-cd docs
-%{__make} -j1 html
-rm -rf _build/html/_sources
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-3
%endif
%install
rm -rf $RPM_BUILD_ROOT
+
%if %{with python2}
%py_install
+
+%py_postclean
%endif
%if %{with python3}
@@ -88,7 +122,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc Changelog README.rst
+%doc Changelog LICENSE README.rst
%{py_sitescriptdir}/%{module}
%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
%endif
@@ -96,7 +130,7 @@ rm -rf $RPM_BUILD_ROOT
%if %{with python3}
%files -n python3-%{module}
%defattr(644,root,root,755)
-%doc Changelog README.rst
+%doc Changelog LICENSE README.rst
%{py3_sitescriptdir}/%{module}
%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
%endif
@@ -104,5 +138,5 @@ rm -rf $RPM_BUILD_ROOT
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
-%doc docs/_build/html/*
+%doc docs/_build/html/{_modules,_static,reference,*.html,*.js}
%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-vine.git/commitdiff/1d3672260f39b13fe253cdd3ed91000855998e20
More information about the pld-cvs-commit
mailing list