[packages/python-PasteScript] - updated to 2.0.2, added tests, unified apidocs packaging

qboosh qboosh at pld-linux.org
Sun Oct 29 10:52:12 CET 2023


commit d2f9f7f9457cffb50d198efead1473542d068053
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 29 09:47:32 2023 +0100

    - updated to 2.0.2, added tests, unified apidocs packaging

 python-PasteScript.spec | 81 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 56 insertions(+), 25 deletions(-)
---
diff --git a/python-PasteScript.spec b/python-PasteScript.spec
index 018e530..fdc4d66 100644
--- a/python-PasteScript.spec
+++ b/python-PasteScript.spec
@@ -1,28 +1,33 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+
 Summary:	A pluggable command-line tool
 Summary(pl.UTF-8):	Narzędzie linii poleceń z obsługą wtyczek
 Name:		python-PasteScript
-Version:	1.7.5
-Release:	4
-License:	X11/MIT
+# keep <3.3 here for python2 support
+Version:	2.0.2
+Release:	1
+License:	MIT
 Group:		Libraries/Python
-Source0:	http://cheeseshop.python.org/packages/source/P/PasteScript/PasteScript-%{version}.tar.gz
-# Source0-md5:	4c72d78dcb6bb993f30536842c16af4d
-URL:		http://pythonpaste.org/script/
-BuildRequires:	rpmbuild(macros) >= 1.710
+#Source0Download: https://pypi.org/simple/pastescript/
+Source0:	https://files.pythonhosted.org/packages/source/P/PasteScript/PasteScript-%{version}.tar.gz
+# Source0-md5:	ccb3045445097192ca71a13b746c77b2
+Patch0:		%{name}-template_dir_assemble.patch
+URL:		https://pypi.org/project/pastescript/
+BuildRequires:	python-devel >= 1:2.6
+BuildRequires:	python-setuptools >= 0.6-0.a9.1
+%if %{with tests}
 BuildRequires:	python-Paste >= 1.3
 BuildRequires:	python-PasteDeploy >= 1.3.3
-BuildRequires:	python-devel
-BuildRequires:	python-setuptools >= 0.6-0.a9.1
+BuildRequires:	python-cheetah
+BuildRequires:	python-nose >= 0.11
+BuildRequires:	python-six
+%endif
 BuildRequires:	rpm-pythonprov
-%pyrequires_eq	python-modules
-Patch0:		%{name}-template_dir_assemble.patch
-Requires:	python-Beaker >= 0.7.5
-Requires:	python-FormEncode >= 0.7.0
-Requires:	python-Mako >= 0.1.8
-Requires:	python-Routes >= 1.7
-Requires:	python-cheetah
-Requires:	python-decorator >= 2.1.0
-Requires:	python-nose >= 0.9.3
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python-modules >= 1:2.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -44,6 +49,17 @@ możliwości ma wbudowane:
 - możliwość użycia w aplikacjach WWW z konfiguracją opartą na
   paste.deploy.
 
+%package apidocs
+Summary:	API documentation for Python PasteScript module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona PasteScript
+Group:		Documentation
+
+%description apidocs
+API documentation for Python PasteScript module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona PasteScript.
+
 %prep
 %setup -q -n PasteScript-%{version}
 %patch0 -p1
@@ -51,21 +67,36 @@ możliwości ma wbudowane:
 %build
 %py_build
 
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+nosetests-%{py_ver} tests -e test_list
+# test_list requires clean venv(?)
+%endif
+
+%if %{with doc}
+sphinx-build-2 -b html docs docs/build/html
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
-%py_install \
-	--single-version-externally-managed \
-	--optimize=2 \
-	--root=$RPM_BUILD_ROOT
 
-find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -and -not -path *templates* | xargs rm -f
+%py_install
+
+find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -and -not -path *templates* | xargs %{__rm}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc docs/
+%doc README.rst
 %attr(755,root,root) %{_bindir}/paster
 %{py_sitescriptdir}/paste/script
-%{py_sitescriptdir}/Paste*
+%{py_sitescriptdir}/PasteScript-%{version}-py*.egg-info
+%{py_sitescriptdir}/PasteScript-%{version}-py*-nspkg.pth
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/build/html/{_static,modules,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-PasteScript.git/commitdiff/d2f9f7f9457cffb50d198efead1473542d068053



More information about the pld-cvs-commit mailing list