[packages/python-path] - updated to 10.1 - added sphinx patch (fixes docs build) - added python3- and -apidocs packages

qboosh qboosh at pld-linux.org
Sat Mar 11 17:07:01 CET 2017


commit b3ea5b354379e7c54903d40261c5cbd5a22cb963
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Mar 11 17:09:09 2017 +0100

    - updated to 10.1
    - added sphinx patch (fixes docs build)
    - added python3- and -apidocs packages

 python-path-sphinx.patch |  11 ++++
 python-path.spec         | 159 +++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 144 insertions(+), 26 deletions(-)
---
diff --git a/python-path.spec b/python-path.spec
index 5a198f3..e9e5420 100644
--- a/python-path.spec
+++ b/python-path.spec
@@ -1,50 +1,157 @@
+#
+# Conditional build:
+%bcond_without	python2	# CPython 2.x module
+%bcond_without	python3	# CPython 3.x module
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# py.test unit tests
 
-%define 	module	path
-
-Summary:	Functionality wrapper of the os.path module
-Summary(pl.UTF-8):	Wraper funkcjonalności modułu os.path
+Summary:	Python 2 module wrapper for os.path
+Summary(pl.UTF-8):	Moduł Pythona 2 obudowujący os.path
 Name:		python-path
-Version:	2.0.4
-Release:	6
-License:	Custom (do, what you want)
+Version:	10.1
+Release:	1
+License:	MIT
 Group:		Libraries/Python
-Source0:	http://www.jorendorff.com/articles/python/path/%{module}.py
-# NoSource0-md5: 9ae93736f9845827aed23bcfa0aaa6ea
-URL:		http://www.jorendorff.com/articles/python/path/
-BuildRequires:	python
-BuildRequires:	python-modules >= 2.2
-BuildRequires:	rpm-perlprov
+#Source0Download: https://pypi.python.org/simple/path.py
+Source0:	https://pypi.python.org/packages/5d/54/4b2301e48a5889de9d121f6232e1833f19513fb24a93c0cbdb919eeec1dd/path.py-%{version}.tar.gz
+# Source0-md5:	f9d31317ceeb798f6b5eac8d3b8e5988
+Patch0:		%{name}-sphinx.patch
+URL:		https://github.com/jaraco/path.py
+%if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
+BuildRequires:	glibc-localedb-all
+%endif
+%if %{with python2}
+BuildRequires:	python >= 1:2.7
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools
+BuildRequires:	python-setuptools_scm >= 1.15.0
+%if %{with tests}
+BuildRequires:	python-appdirs
+BuildRequires:	python-pytest >= 2.8
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3 >= 1:3.3
+BuildRequires:	python3-modules >= 1:3.3
+BuildRequires:	python3-setuptools
+BuildRequires:	python3-setuptools_scm >= 1.15.0
+%if %{with tests}
+BuildRequires:	python3-appdirs
+BuildRequires:	python3-pytest >= 2.8
+%endif
+%endif
 BuildRequires:	rpm-pythonprov
-Requires:	python >= 2.2
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	sphinx-pdg
+BuildRequires:	python3-rst.linker
+%endif
+Requires:	python-modules >= 1:2.7
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-This module provides a single class that wraps the functionality in
-the os.path module. You wouldn't think that would be so helpful, but
-in practice I find it much more pleasant to write and to read.
+path.py implements a path objects as first-class entities, allowing
+common operations on files to be invoked on those path objects
+directly.
 
 %description -l pl.UTF-8
-Moduł ten udostępnia pojedynczą klasę będącą wrapperem na
-funkcjonalność modułu os.path.
+path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe,
+pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio
+na tych ścieżkach.
+
+%package -n python3-path
+Summary:	Python 3 module wrapper for os.path
+Summary(pl.UTF-8):	Moduł Pythona 3 obudowujący os.path
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.3
+
+%description -n python3-path
+path.py implements a path objects as first-class entities, allowing
+common operations on files to be invoked on those path objects
+directly.
+
+%description -n python3-path -l pl.UTF-8
+path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe,
+pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio
+na tych ścieżkach.
+
+%package apidocs
+Summary:	Documentation for Python path.py module
+Summary(pl.UTF-8):	Dokumentacja modułu Pythona path.py
+Group:		Documentation
+
+%description apidocs
+Documentation for Python path.py module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja modułu Pythona path.py.
 
 %prep
+%setup -q -n path.py-%{version}
+%patch0 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 %{__python} -m pytest test_path.py
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 %{__python3} -m pytest test_path.py
+%endif
+%endif
+
+%if %{with doc}
+install -d docs/_static
+%{__make} -C docs html
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{py_sitescriptdir}
 
-install %{SOURCE0} $RPM_BUILD_ROOT%{py_sitescriptdir}
+%if %{with python2}
+%py_install
+
+%py_postclean
+%{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/test_path.py*
+%endif
 
-%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}/
-%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/
+%if %{with python3}
+%py3_install
 
-rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}.py
+%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/test_path.py
+%{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/test_path.*
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%{py_sitescriptdir}/%{module}.pyc
-%{py_sitescriptdir}/%{module}.pyo
+%doc CHANGES.rst README.rst
+%{py_sitescriptdir}/path.py[co]
+%{py_sitescriptdir}/path.py-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-path
+%defattr(644,root,root,755)
+%doc CHANGES.rst README.rst
+%{py3_sitescriptdir}/path.py
+%{py3_sitescriptdir}/__pycache__/path.cpython-*.py[co]
+%{py3_sitescriptdir}/path.py-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/python-path-sphinx.patch b/python-path-sphinx.patch
new file mode 100644
index 0000000..89c3230
--- /dev/null
+++ b/python-path-sphinx.patch
@@ -0,0 +1,11 @@
+--- path.py-10.1/CHANGES.rst.orig	2017-01-23 13:23:35.000000000 +0100
++++ path.py-10.1/CHANGES.rst	2017-03-11 16:24:13.470127210 +0100
+@@ -39,7 +39,7 @@
+ ---
+ 
+ - Refreshed project metadata based on `jaraco's project
+-  skeleton <https://github.com/jaraco/skeleton/tree/spaces>_.
++  skeleton <https://github.com/jaraco/skeleton/tree/spaces>`_.
+ - Releases are now automatically published via Travis-CI.
+ - #111: More aggressively trap errors when importing
+   ``pkg_resources``.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-path.git/commitdiff/b3ea5b354379e7c54903d40261c5cbd5a22cb963



More information about the pld-cvs-commit mailing list