[packages/python-distro] - updated to 1.5.0 - added docs patch and -apidocs subpackage

qboosh qboosh at pld-linux.org
Sun Apr 19 12:41:21 CEST 2020


commit 4886820c6236d010f5e3b80eb1542e61997d3253
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Apr 19 12:41:31 2020 +0200

    - updated to 1.5.0
    - added docs patch and -apidocs subpackage

 python-distro-docs.patch | 15 ++++++++
 python-distro.spec       | 97 +++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 90 insertions(+), 22 deletions(-)
---
diff --git a/python-distro.spec b/python-distro.spec
index 2e60a7b..cbc69d1 100644
--- a/python-distro.spec
+++ b/python-distro.spec
@@ -1,35 +1,42 @@
 #
 # Conditional build:
-%bcond_without	tests	# do not perform "make test"
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
 %bcond_without	python2 # CPython 2.x module
 %bcond_without	python3 # CPython 3.x module
 
 %define 	module	distro
 Summary:	An OS platform information API
+Summary(pl.UTF-8):	API do intermacji o platformie systemu operacyjnego
 Name:		python-%{module}
-Version:	1.4.0
+Version:	1.5.0
 Release:	1
 License:	Apache v2.0
 Group:		Libraries/Python
-Source0:	https://github.com/nir0s/%{module}/archive/v%{version}/%{module}-%{version}.tar.gz
-# Source0-md5:	ada22d75b32a4056ed13f32b9d986a2d
+Source0:	https://github.com/nir0s/distro/archive/v%{version}/%{module}-%{version}.tar.gz
+# Source0-md5:	da1cab49e8aad7bd6ae5c9f66657bd2e
+Patch0:		%{name}-docs.patch
 URL:		https://github.com/nir0s/distro
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.713
 %if %{with python2}
-BuildRequires:	python-modules
+BuildRequires:	python-modules >= 1:2.7
 BuildRequires:	python-setuptools
 %if %{with tests}
-BuildRequires:	python-test
+BuildRequires:	python-pytest
 %endif
 %endif
 %if %{with python3}
-BuildRequires:	python3-modules
+BuildRequires:	python3-modules >= 1:3.4
 BuildRequires:	python3-setuptools
 %if %{with tests}
-BuildRequires:	python3-test
+BuildRequires:	python3-pytest
+%endif
 %endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	sphinx-pdg >= 1.1
 %endif
+Requires:	python-modules >= 1:2.7
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -37,24 +44,66 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 distro provides information about the OS distribution it runs on, such
 as a reliable machine-readable ID, or version information.
 
+%description -l pl.UTF-8
+distro udostępnia informacje o dystrybucji systemu operacyjnego, na
+jakim działa, takie jak wiarygodny, czytelny dla maszyny identyfikator
+albo informację o wersji.
+
 %package -n python3-%{module}
-Summary:	Parse human-readable date/time strings in Python
+Summary:	An OS platform information API
+Summary(pl.UTF-8):	API do intermacji o platformie systemu operacyjnego
 Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.4
 
 %description -n python3-%{module}
 distro provides information about the OS distribution it runs on, such
 as a reliable machine-readable ID, or version information.
 
+It is the recommended replacement for Python's original
+platform.linux_distribution function removed in Python 3.8.
+
+%description -n python3-%{module} -l pl.UTF-8
+distro udostępnia informacje o dystrybucji systemu operacyjnego, na
+jakim działa, takie jak wiarygodny, czytelny dla maszyny identyfikator
+albo informację o wersji.
+
+Jest to zalecany zamiennik oryginalnej pythonowej funkcji
+platform.linux_distribution, usuniętej w Pythonie 3.8.
+
+%package apidocs
+Summary:	API documentation for Python distro module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona distro
+Group:		Documentation
+
+%description apidocs
+API documentation for Python distro module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona distro.
+
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+%{__python} -m pytest tests
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m pytest tests
+%endif
+%endif
+
+%if %{with doc}
+sphinx-build -b html docs docs/_build/html
 %endif
 
 %install
@@ -75,18 +124,22 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc LICENSE
-%doc CONTRIBUTORS.md CHANGELOG.md README.md
-%{py_sitescriptdir}/%{module}.*
-%{py_sitescriptdir}/%{module}-%{version}-*.egg-info
+%doc CHANGELOG.md CONTRIBUTORS.md LICENSE README.md
+%{py_sitescriptdir}/distro.py[co]
+%{py_sitescriptdir}/distro-%{version}-py*.egg-info
 
 %if %{with python3}
 %files -n python3-%{module}
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/distro
-%doc LICENSE
-%doc CONTRIBUTORS.md CHANGELOG.md README.md
-%{py3_sitescriptdir}/%{module}.py
-%{py3_sitescriptdir}/__pycache__/%{module}*.py[co]
-%{py3_sitescriptdir}/%{module}*.egg-info
+%doc CHANGELOG.md CONTRIBUTORS.md LICENSE README.md
+%{py3_sitescriptdir}/distro.py
+%{py3_sitescriptdir}/__pycache__/distro.cpython-*.py[co]
+%{py3_sitescriptdir}/distro-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_modules,_static,*.html,*.js}
 %endif
diff --git a/python-distro-docs.patch b/python-distro-docs.patch
new file mode 100644
index 0000000..157c8b6
--- /dev/null
+++ b/python-distro-docs.patch
@@ -0,0 +1,15 @@
+--- distro-1.5.0/docs/conf.py.orig	2020-03-30 23:10:27.000000000 +0200
++++ distro-1.5.0/docs/conf.py	2020-04-19 12:21:54.228345350 +0200
+@@ -49,11 +49,7 @@
+ source_encoding = 'utf-8'
+ 
+ # The master toctree document.
+-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+-if on_rtd:
+-    master_doc = 'index'
+-else:
+-    master_doc = 'docs/index'
++master_doc = 'index'
+ 
+ # General information about the project.
+ project = u'distro'
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-distro.git/commitdiff/4886820c6236d010f5e3b80eb1542e61997d3253



More information about the pld-cvs-commit mailing list