# Circular dependencies in the testing chain %if 0%{?epel} == 9 %bcond_with test %else %bcond_without test %endif Name: python-backports-tarfile Version: 1.2.0 Release: %autorelease Summary: Backport of CPython tarfile module License: MIT URL: https://github.com/jaraco/backports.tarfile Source: %{pypi_source backports_tarfile} BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-test BuildRequires: tomcli %global _description %{expand: Backport of CPython tarfile module.} %description %_description %package -n python3-backports-tarfile Summary: %{summary} %description -n python3-backports-tarfile %_description %prep %autosetup -p1 -n backports_tarfile-%{version} # Remove dev dependencies tomcli set pyproject.toml lists delitem "project.optional-dependencies.testing" "pytest-.*" %if 0%{?epel} == 9 # Change the build backend in EPEL9 because `setuptools>=61.2` is needed for PEP621 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" tomcli set pyproject.toml lists str "tool.hatch.build.targets.wheel.packages" "backports" %endif sed -i "s/\\('-m', 'backports.tarfile',\\)/\\1 __cleanenv=False,/g" tests/test_tarfile.py %generate_buildrequires %pyproject_buildrequires %{?with_test:-x testing} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files backports %check %pyproject_check_import %if %{with test} %pytest %endif %files -n python3-backports-tarfile -f %{pyproject_files} %license LICENSE %doc README.rst %changelog %autochangelog