[packages/python-parsel] - new

qboosh qboosh at pld-linux.org
Tue Jul 15 06:24:34 CEST 2025


commit 07ba38d864f385fd69a39c11450a23d79bbe5f23
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Jul 15 06:26:05 2025 +0200

    - new

 python-parsel.spec | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)
---
diff --git a/python-parsel.spec b/python-parsel.spec
new file mode 100644
index 0000000..7d220d9
--- /dev/null
+++ b/python-parsel.spec
@@ -0,0 +1,157 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_with	python3 # CPython 3.x module (built from python3-parsel.spec)
+
+Summary:	Library to extract data from HTML and XML using XPath and CSS selectors
+Summary(pl.UTF-8):	Biblioteka do wydobywania danych z HTML-a i XML-a przy użyciu XPath i selektorów CSS
+Name:		python-parsel
+# keep 1.6.x here for python2 support
+Version:	1.6.0
+Release:	1
+License:	BSD
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/parsel/
+Source0:	https://files.pythonhosted.org/packages/source/p/parsel/parsel-%{version}.tar.gz
+# Source0-md5:	524b9519a20f401cd44f06d7f725c856
+URL:		https://pypi.org/project/parsel/
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-pytest-runner
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-cssselect >= 0.9
+BuildRequires:	python-functools32
+BuildRequires:	python-lxml
+BuildRequires:	python-pytest
+BuildRequires:	python-six >= 1.6.0
+BuildRequires:	python-w3lib >= 1.19.0
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-pytest-runner
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-cssselect >= 0.9
+BuildRequires:	python3-lxml
+BuildRequires:	python3-pytest
+BuildRequires:	python3-six >= 1.6.0
+BuildRequires:	python3-w3lib >= 1.19.0
+%endif
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python-sphinx-notfound-page
+BuildRequires:	python-sphinx_rtd_theme
+BuildRequires:	sphinx-pdg-2
+%endif
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Parsel is a BSD-licensed Python library to extract and remove data
+from HTML and XML using XPath and CSS selectors, optionally combined
+with regular expressions.
+
+%description -l pl.UTF-8
+Parsel to dostępna na licencji BSD biblioteka Pythona do wydobywania i
+usuwania danych z HTML-a i XML-a przy użyciu XPath i selektorów CSS,
+opcjonalnie połączonych z wyrażeniami regularnymi.
+
+%package -n python3-parsel
+Summary:	Library to extract data from HTML and XML using XPath and CSS selectors
+Summary(pl.UTF-8):	Biblioteka do wydobywania danych z HTML-a i XML-a przy użyciu XPath i selektorów CSS
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.5
+
+%description -n python3-parsel
+Parsel is a BSD-licensed Python library to extract and remove data
+from HTML and XML using XPath and CSS selectors, optionally combined
+with regular expressions.
+
+%description -n python3-parsel -l pl.UTF-8
+Parsel to dostępna na licencji BSD biblioteka Pythona do wydobywania i
+usuwania danych z HTML-a i XML-a przy użyciu XPath i selektorów CSS,
+opcjonalnie połączonych z wyrażeniami regularnymi.
+
+%package apidocs
+Summary:	API documentation for Python parsel module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona parsel
+Group:		Documentation
+
+%description apidocs
+API documentation for Python parsel module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona parsel.
+
+%prep
+%setup -q -n parsel-%{version}
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python} -m pytest tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python3} -m pytest tests
+%endif
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-2
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc LICENSE NEWS README.rst
+%{py_sitescriptdir}/parsel
+%{py_sitescriptdir}/parsel-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-parsel
+%defattr(644,root,root,755)
+%doc LICENSE NEWS README.rst
+%{py3_sitescriptdir}/parsel
+%{py3_sitescriptdir}/parsel-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_modules,_static,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-parsel.git/commitdiff/07ba38d864f385fd69a39c11450a23d79bbe5f23



More information about the pld-cvs-commit mailing list