pyproject-rpm-macros/tests/python-coverage-pth.spec
Miro Hrončok aac6644d02 Add the -M flag to %pyproject_save_files
- The flag can be used to indicate no Python modules should be saved

The change wrt users using '*' was necessary,
as `glob` was undefined when `module_globs` was empty.
2025-02-05 16:17:50 +01:00

51 lines
1.0 KiB
RPMSpec

Name: python-coverage-pth
Version: 0.0.2
Release: 0%{?dist}
Summary: Coverage PTH file to enable coverage at the virtualenv level
License: BSD
URL: https://github.com/dougn/coverage_pth
Source: %{pypi_source coverage_pth}
BuildArch: noarch
BuildRequires: python3-devel
%description
This package exists to test %%pyproject_save_files -M.
It contains no Python modules, just a single .pth file.
%package -n python3-coverage-pth
Summary: %{summary}
%description -n python3-coverage-pth
...
%prep
%autosetup -p1 -n coverage_pth-%{version}
# support multi-digit Python versions in setup.py regexes
sed -i 's/d)/d+)/' setup.py
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
# internal check for our macros:
# this should not work without -M
%pyproject_save_files -L && exit 1 || true
# but this should:
%pyproject_save_files -LM
%files -n python3-coverage-pth -f %{pyproject_files}
%{python3_sitelib}/coverage_pth.pth