[packages/python3-pep440] - pl, tests
qboosh
qboosh at pld-linux.org
Sun Nov 16 21:55:30 CET 2025
commit e932f4959ee86bc7be1688aab5b4918923cf2105
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Nov 16 21:55:28 2025 +0100
- pl, tests
python3-pep440.spec | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
---
diff --git a/python3-pep440.spec b/python3-pep440.spec
index 787bbfb..58349d8 100644
--- a/python3-pep440.spec
+++ b/python3-pep440.spec
@@ -1,4 +1,9 @@
+#
+# Conditional build:
+%bcond_without tests # unit tests
+
Summary: Utils to check whether versions number match PEP 440
+Summary(pl.UTF-8): Narzędzia do sprawdzania zgodności numerów wersji z PEP 440
Name: python3-pep440
Version: 0.1.2
Release: 1
@@ -14,6 +19,10 @@ BuildRequires: python3-flit_core < 4
BuildRequires: python3-flit_core >= 3.4
BuildRequires: python3-installer
BuildRequires: python3-modules >= 1:3.7
+%if %{with tests}
+BuildRequires: python3-pytest
+BuildRequires: python3-pytest-console-scripts
+%endif
BuildRequires: rpmbuild(macros) >= 2.044
Requires: python3-modules >= 1:3.7
BuildArch: noarch
@@ -23,12 +32,34 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
A simple package with utils to check whether versions number match PEP
440.
+%description -l pl.UTF-8
+Prosty pakiet z narzędziami do sprawdzania, czy numer wersji jest
+zgodny z PEP 440.
+
%prep
%setup -q -n pep440-%{version}
%build
%py3_build_pyproject
+%if %{with tests}
+# simulate packaged console script
+install -d test-bin
+cat >test-bin/pep440 <<'EOF'
+#!%{__python3}
+import sys
+from pep440.__main__ import main
+sys.exit(main())
+EOF
+chmod 755 test-bin/pep440
+
+PATH=$(pwd)/test-bin:$PATH \
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS=pytest_console_scripts \
+PYTHONPATH=$(pwd) \
+%{__python3} -m pytest tests
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-pep440.git/commitdiff/e932f4959ee86bc7be1688aab5b4918923cf2105
More information about the pld-cvs-commit
mailing list