[packages/python3-tinycss2] - finished package, added -apidocs

qboosh qboosh at pld-linux.org
Thu Dec 16 18:07:09 CET 2021


commit 3c78f8a4d0576eeaf3eb3d881839c2952551533a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Dec 16 18:07:47 2021 +0100

    - finished package, added -apidocs

 python3-tinycss2.spec | 62 +++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 53 insertions(+), 9 deletions(-)
---
diff --git a/python3-tinycss2.spec b/python3-tinycss2.spec
index 066e1e1..b447ce4 100644
--- a/python3-tinycss2.spec
+++ b/python3-tinycss2.spec
@@ -1,53 +1,97 @@
 #
 # Conditional build:
+%bcond_without	doc	# Sphinx documentation
 %bcond_without	tests	# unit tests
 
 Summary:	Low-level CSS parser for Python
+Summary(pl.UTF-8):	Niskopoziomowy parser CSS dla Pythona
 Name:		python3-tinycss2
 Version:	1.1.0
 Release:	1
 License:	BSD
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/tinycss2/
 Source0:	https://files.pythonhosted.org/packages/source/t/tinycss2/tinycss2-%{version}.tar.gz
 # Source0-md5:	7caf513c4e87fc2449dcfbf407a8416f
 Patch0:		disable-flake8-isort-for-pytest.patch
 Patch1:		disable-missing-data-tests.patch
-URL:		https://pypi.python.org/pypi/tinycss2/
-# required to run the tests
+URL:		https://pypi.org/project/tinycss2/
+BuildRequires:	python3-modules >= 1:3.6
+BuildRequires:	python3-setuptools
 %if %{with tests}
 BuildRequires:	python3-pytest
 BuildRequires:	python3-pytest-cov
-BuildRequires:	python3-pytest-runner
-BuildRequires:	python3-setuptools
 BuildRequires:	python3-webencodings >= 0.4
 %endif
+%if %{with doc}
+BuildRequires:	python3-sphinx_rtd_theme
+BuildRequires:	sphinx-pdg-3
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	sed >= 4.0
 BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 tinycss2 is a modern, low-level CSS parser for Python. tinycss2 is a
 rewrite of tinycss with a simpler API, based on the more recent CSS
 Syntax Level 3 specification.
 
+%description -l pl.UTF-8
+tinycss2 to nowoczesny, niskopoziomowy parser CSS dla Ptyhona. Jest to
+napisany od początku tinycss z prostszym API, oparty na nowszej
+specyfikacji CSS Syntax Level 3.
+
+%package apidocs
+Summary:	API documentation for Python tinycss2 module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona tinycss2
+Group:		Documentation
+
+%description apidocs
+API documentation for Python tinycss2 module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona tinycss2.
+
 %prep
 %setup -n tinycss2-%{version}
 %patch0 -p1
 %patch1 -p1
 
+# for pythonegg dependencies
+%{__sed} -i -e 's/distutils.core/setuptools/' setup.py
+
 %build
 %py3_build
 
-%install
-rm -rf $RPM_BUILD_ROOT
-%py3_install
-
 %if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
 %{__python3} -m pytest -v
 %endif
 
+%if %{with doc}
+cd docs
+PYTHONPATH=$(pwd)/.. \
+%{__python3} -m sphinx -W . build/html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.rst
+%doc LICENSE README.rst
 %{py3_sitescriptdir}/tinycss2
 %{py3_sitescriptdir}/tinycss2-%{version}-py*.egg-info
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/build/html/{_static,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-tinycss2.git/commitdiff/3c78f8a4d0576eeaf3eb3d881839c2952551533a



More information about the pld-cvs-commit mailing list