[packages/python3-libdiscid] - up to 2.0.3
baggins
baggins at pld-linux.org
Sat Jun 7 15:34:00 CEST 2025
commit 8f9700a84f3ff2737b8d817124c5d99134a90a0a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Jun 7 16:53:52 2025 +0200
- up to 2.0.3
python3-libdiscid.spec | 94 +++++++++++++++-----------------------------------
1 file changed, 28 insertions(+), 66 deletions(-)
---
diff --git a/python3-libdiscid.spec b/python3-libdiscid.spec
index edde030..17831ae 100644
--- a/python3-libdiscid.spec
+++ b/python3-libdiscid.spec
@@ -2,56 +2,35 @@
# Conditional build:
%bcond_without doc # Sphinx documentation
%bcond_without tests # unit tests
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
-Summary: Python 2 bindings for libdiscid library
-Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki libdiscid
+Summary: Python bindings for libdiscid library
+Summary(pl.UTF-8): Wiązania Pythona do biblioteki libdiscid
Name: python3-libdiscid
-Version: 1.0
-Release: 11
+Version: 2.0.3
+Release: 1
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.python.org/simple/python-libdiscid
-Source0: https://files.pythonhosted.org/packages/source/p/python-libdiscid/%{name}-%{version}.tar.gz
-# Source0-md5: 073812900a274a5d41fd4afa4e0b61bf
+Source0: https://files.pythonhosted.org/packages/source/p/python-libdiscid/python-libdiscid-%{version}.tar.gz
+# Source0-md5: f7ae90cfff90ffcb3332540e7a209997
URL: https://github.com/sebastinas/python-libdiscid
BuildRequires: libdiscid-devel
-%if %{with python2}
-BuildRequires: python-Cython >= 0.15
-BuildRequires: python-devel >= 1:2.7
-BuildRequires: python-pkgconfig
-BuildRequires: python-setuptools
-%endif
-%if %{with python3}
BuildRequires: python3-Cython >= 0.15
-BuildRequires: python3-devel >= 1:3.4
+BuildRequires: python3-build
+BuildRequires: python3-devel >= 1:3.8
+BuildRequires: python3-installer
BuildRequires: python3-pkgconfig
-BuildRequires: python3-setuptools
-%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%{?with_doc:BuildRequires: sphinx-pdg}
-Requires: python-modules >= 1:2.7
+Requires: python3-modules >= 1:3.8
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-Python 2 bindings for libdiscid library.
+Python bindings for libdiscid library.
%description -l pl.UTF-8
-Wiązania Pythona 2 do biblioteki libdiscid.
-
-%package -n python3-libdiscid
-Summary: Python 3 bindings for libdiscid library
-Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki libdiscid
-Group: Libraries/Python
-Requires: python3-modules >= 1:3.4
-
-%description -n python3-libdiscid
-Python 3 bindings for libdiscid library.
-
-%description -n python3-libdiscid -l pl.UTF-8
-Wiązania Pythona 3 do biblioteki libdiscid.
+Wiązania Pythona do biblioteki libdiscid.
%package apidocs
Summary: API documentation for Python libdiscid module
@@ -65,63 +44,46 @@ API documentation for Python libdiscid module.
Dokumentacja API modułu Pythona libdiscid.
%prep
-%setup -q
+%setup -q -n python-libdiscid-%{version}
%build
-%if %{with python2}
-%py_build %{?with_tests:test}
-%endif
-
-%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build_pyproject
+
+%if %{with tests}
+%{__python3} -m zipfile -e build-3/*.whl build-3-test
+# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS= \
+%{__python3} -m pytest -o pythonpath="$PWD/build-3-test" build-3-test/libdiscid/tests
%endif
%if %{with doc}
-PYTHONPATH=$(pwd) \
+%{__python3} -m zipfile -e build-3/*.whl build-3-doc
+PYTHONPATH="$PWD/build-3-doc" \
sphinx-build -b html docs docs/html
%endif
%install
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
-%py_install
-
-%py_postclean
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/libdiscid/tests
-%endif
-
-%if %{with python3}
-%py3_install
+%py3_install_pyproject
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/libdiscid/tests
-%endif
%clean
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc LICENSE README.rst changelog
-%dir %{py_sitedir}/libdiscid
-%attr(755,root,root) %{py_sitedir}/libdiscid/_discid.so
-%{py_sitedir}/libdiscid/*.py[co]
-%{py_sitedir}/libdiscid/compat
-%{py_sitedir}/python_libdiscid-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-libdiscid
-%defattr(644,root,root,755)
-%doc LICENSE README.rst changelog
+%doc LICENSE README.md CHANGELOG.md
%dir %{py3_sitedir}/libdiscid
%attr(755,root,root) %{py3_sitedir}/libdiscid/_discid.cpython-*.so
%{py3_sitedir}/libdiscid/*.py
%{py3_sitedir}/libdiscid/__pycache__
+%{py3_sitedir}/libdiscid/_discid.pyi
+%{py3_sitedir}/libdiscid/py.typed
%{py3_sitedir}/libdiscid/compat
-%{py3_sitedir}/python_libdiscid-%{version}-py*.egg-info
-%endif
+%{py3_sitedir}/python_libdiscid-%{version}.dist-info
%if %{with doc}
%files apidocs
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-libdiscid.git/commitdiff/8f9700a84f3ff2737b8d817124c5d99134a90a0a
More information about the pld-cvs-commit
mailing list