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

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


commit 45fbf0a1d933d23fb362dc34cd3be2973a56ff49
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Dec 16 18:19:07 2021 +0100

    - finished package, added -apidocs

 python3-cssselect2.spec | 61 ++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 53 insertions(+), 8 deletions(-)
---
diff --git a/python3-cssselect2.spec b/python3-cssselect2.spec
index 614b73f..fbeb3a1 100644
--- a/python3-cssselect2.spec
+++ b/python3-cssselect2.spec
@@ -1,53 +1,98 @@
 #
 # Conditional build:
+%bcond_without	doc	# Sphinx documentation
 %bcond_without	tests	# unit tests
 
 Summary:	CSS selectors for Python ElementTree
+Summary(pl.UTF-8):	Selektory CSS dla pythonowego ElementTree
 Name:		python3-cssselect2
 Version:	0.4.1
 Release:	1
 License:	BSD
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/cssselect2/
 Source0:	https://files.pythonhosted.org/packages/source/c/cssselect2/cssselect2-%{version}.tar.gz
 # Source0-md5:	6dfd5963c8a5d85f2634d1650b1ddfe1
 Patch0:		disable-flake8-isort-pytest.patch
 URL:		https://cssselect2.readthedocs.io/
+BuildRequires:	python3-modules >= 1:3.6
+BuildRequires:	python3-setuptools >= 1:39.2.0
 %if %{with tests}
 BuildRequires:	python3-pytest
 BuildRequires:	python3-pytest-cov
-BuildRequires:	python3-pytest-runner
-BuildRequires:	python3-setuptools >= 39.2.0
 BuildRequires:	python3-tinycss2
 BuildRequires:	python3-webencodings
 %endif
+%if %{with doc}
+BuildRequires:	python3-Sphinx
+BuildRequires:	python3-sphinx_rtd_theme
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	sed >= 4.0
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
 cssselect2 is a straightforward implementation of CSS3 Selectors for
 markup documents (HTML, XML, etc.) that can be read by
-ElementTree-like parsers, including cElementTree, lxml, html5lib_,
+ElementTree-like parsers, including cElementTree, lxml, html5lib,
 etc.
 
+%description -l pl.UTF-8
+cssselect2 to bezpośrednia implementacja selektorów CSS3 dla
+dokumentów ze znacznikami (HTML, XML itp.), które można czytać
+parserami w stylu ElementTree, w tym cElementTree, lxml, html5lib
+itp.
+
+%package apidocs
+Summary:	API documentation for Python cssselect2 module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona cssselect2
+Group:		Documentation
+
+%description apidocs
+API documentation for Python cssselect2 module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona cssselect2.
+
 %prep
 %setup -n cssselect2-%{version}
 %patch0 -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}/cssselect2
 %{py3_sitescriptdir}/cssselect2-%{version}-py*.egg-info
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/build/html/*
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-cssselect2.git/commitdiff/45fbf0a1d933d23fb362dc34cd3be2973a56ff49



More information about the pld-cvs-commit mailing list