Make package buildable for epel>=9

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
epel9 imports/epel9/python-zipp-3.20.1-2.el9
Cristian Le 5 months ago
parent 0668999d0c
commit 071ed0cb9f
Failed to extract signature

@ -18,6 +18,10 @@ BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest)
BuildRequires: python3dist(jaraco-functools) BuildRequires: python3dist(jaraco-functools)
BuildRequires: python3dist(jaraco-test) BuildRequires: python3dist(jaraco-test)
%if 0%{?epel} == 9
# Change the build backend in EPEL9 because `setuptools>=61.2` is needed for PEP621
BuildRequires: tomcli
%endif
%description %description
A pathlib-compatible Zipfile object wrapper. A backport of the Path object. A pathlib-compatible Zipfile object wrapper. A backport of the Path object.
@ -34,6 +38,11 @@ A pathlib-compatible Zipfile object wrapper. A backport of the Path object.
%autosetup -n %{pypi_name}-%{version} %autosetup -n %{pypi_name}-%{version}
# jaraco.itertools and func_timeout are not available in Fedora yet # jaraco.itertools and func_timeout are not available in Fedora yet
sed -i "/import jaraco.itertools/d" tests/test_path.py sed -i "/import jaraco.itertools/d" tests/test_path.py
%if 0%{?epel} == 9
tomcli set pyproject.toml lists str "build-system.requires" "hatchling" "hatch-vcs"
tomcli set pyproject.toml str "build-system.build-backend" "hatchling.build"
tomcli set pyproject.toml str "tool.hatch.version.source" "vcs"
%endif
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires -r %pyproject_buildrequires -r
@ -47,7 +56,7 @@ sed -i "/import jaraco.itertools/d" tests/test_path.py
%check %check
# Skipped test needs jaraco.itertools # Skipped test needs jaraco.itertools
%pytest -k "not test_joinpath_constant_time" %pytest -k "not test_joinpath_constant_time" %{?el9:--import-mode prepend}
%files -n python3-%{pypi_name} -f %{pyproject_files} %files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE %license LICENSE

Loading…
Cancel
Save