[packages/python-mutagen] - added tests and apidocs
qboosh
qboosh at pld-linux.org
Fri Nov 8 19:57:58 CET 2024
commit b9393e8e25299773180fd5fab607e25a21a34e4f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Nov 8 19:40:38 2024 +0100
- added tests and apidocs
python-mutagen.spec | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
---
diff --git a/python-mutagen.spec b/python-mutagen.spec
index c4ec31e..1d2ae7b 100644
--- a/python-mutagen.spec
+++ b/python-mutagen.spec
@@ -2,6 +2,8 @@
# Conditional build:
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
#
%define module mutagen
Summary: Audio metadata reader/writer for Python 2
@@ -20,14 +22,23 @@ URL: https://github.com/quodlibet/mutagen
BuildRequires: python-devel >= 1:2.7
BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pytest
+%endif
%endif
%if %{with python3}
BuildRequires: python3-devel >= 1:3.5
BuildRequires: python3-modules >= 1:3.5
BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pytest
+%endif
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: sphinx-pdg-2 >= 1.3
+%endif
Requires: python-modules >= 1:2.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -76,16 +87,42 @@ zaimplementowany w czystym Pythonie. Obsługuje odczyt ID3v1.1,
ID3v2.2, ID3v2.3, ID3v2.4, APEv2 i FLAC oraz zapis ID3v1.1, ID3v2.4,
APEv2 i FLAC.
+%package apidocs
+Summary: API documentation for Python mutagen module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona mutagen
+Group: Documentation
+
+%description apidocs
+API documentation for Python mutagen module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona mutagen.
+
%prep
%setup -q -n %{module}-%{version}
%build
%if %{with python2}
%py_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 \
+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}
+sphinx-build-2 -b html docs docs/_build/html
%endif
%install
@@ -137,3 +174,9 @@ rm -rf $RPM_BUILD_ROOT
%{py3_sitescriptdir}/mutagen
%{py3_sitescriptdir}/mutagen-%{version}-py*.egg-info
%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_images,_static,api,man,user,*.html,*.js}
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-mutagen.git/commitdiff/b9393e8e25299773180fd5fab607e25a21a34e4f
More information about the pld-cvs-commit
mailing list