From 9cd97d13383e51a9e9cdc7149f64c133ee0b3209 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jan 25 2024 11:29:49 +0000 Subject: Generate test BuildRequires --- diff --git a/python-pip.spec b/python-pip.spec index f8ba025..606cab6 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -14,7 +14,7 @@ Name: python-%{srcname} Version: %{base_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 5%{?dist} Summary: A tool for installing and managing Python packages # We bundle a lot of libraries with pip, which itself is under MIT license. @@ -153,20 +153,8 @@ BuildRequires: python%{python3_pkgversion}-devel # The minimal version is for bundled provides verification script BuildRequires: python3-rpm-generators >= 11-8 BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: bash-completion -%if %{with tests} -BuildRequires: python%{python3_pkgversion}-cryptography -BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: python%{python3_pkgversion}-pretend -BuildRequires: python%{python3_pkgversion}-freezegun -BuildRequires: python%{python3_pkgversion}-scripttest -BuildRequires: python%{python3_pkgversion}-virtualenv -BuildRequires: python%{python3_pkgversion}-werkzeug -BuildRequires: python%{python3_pkgversion}-pyyaml -BuildRequires: python%{python3_pkgversion}-tomli-w -BuildRequires: python%{python3_pkgversion}-installer -%endif BuildRequires: python%{python3_pkgversion}-wheel +BuildRequires: bash-completion BuildRequires: ca-certificates Requires: ca-certificates @@ -240,6 +228,18 @@ sed -i '/\.exe/d' setup.py # https://github.com/pypa/pip/pull/12046 %{python3} -c 'from pathlib import Path; p = Path("AUTHORS.txt"); p.write_text("".join(c for c in p.read_text() if c != "\u202e"))' +# Remove unused test requirements +sed -Ei '/pytest-(cov|xdist|rerunfailures)/d' tests/requirements.txt + + +%if %{with tests} +%generate_buildrequires +# we only use this to generate test requires +# the "pyproject" part is explicitly disabled as it generates a requirement on pip +%pyproject_buildrequires -N tests/requirements.txt +%endif + + %build %py3_build_wheel @@ -362,6 +362,10 @@ pytest_k='not completion' %{python_wheel_dir}/%{python_wheel_name} %changelog +* Mon Jan 22 2024 Miro Hrončok - 23.3.1-5 +- Switched to autogenerated BuildRequires for test dependencies, + which removed some that were no longer necessary + * Mon Jan 22 2024 Fedora Release Engineering - 23.3.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild