Generate test BuildRequires

This commit is contained in:
Miro Hrončok 2024-01-13 12:45:25 +01:00
parent 2a7f383501
commit 9cd97d1338

View File

@ -14,7 +14,7 @@
Name: python-%{srcname} Name: python-%{srcname}
Version: %{base_version}%{?prerel:~%{prerel}} Version: %{base_version}%{?prerel:~%{prerel}}
Release: 4%{?dist} Release: 5%{?dist}
Summary: A tool for installing and managing Python packages Summary: A tool for installing and managing Python packages
# We bundle a lot of libraries with pip, which itself is under MIT license. # 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 # The minimal version is for bundled provides verification script
BuildRequires: python3-rpm-generators >= 11-8 BuildRequires: python3-rpm-generators >= 11-8
BuildRequires: python%{python3_pkgversion}-setuptools 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: python%{python3_pkgversion}-wheel
BuildRequires: bash-completion
BuildRequires: ca-certificates BuildRequires: ca-certificates
Requires: ca-certificates Requires: ca-certificates
@ -240,6 +228,18 @@ sed -i '/\.exe/d' setup.py
# https://github.com/pypa/pip/pull/12046 # 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"))' %{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 %build
%py3_build_wheel %py3_build_wheel
@ -362,6 +362,10 @@ pytest_k='not completion'
%{python_wheel_dir}/%{python_wheel_name} %{python_wheel_dir}/%{python_wheel_name}
%changelog %changelog
* Mon Jan 22 2024 Miro Hrončok <mhroncok@redhat.com> - 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 <releng@fedoraproject.org> - 23.3.1-4 * Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 23.3.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild