Stop invoking setup.py during the build

This is a preparation for pip 24.1 which drops setup.py entirely.

[skip changelog]
This commit is contained in:
Miro Hrončok 2024-05-24 15:06:49 +02:00
commit 471c9d6f85

View file

@ -150,6 +150,7 @@ BuildRequires: python%{python3_pkgversion}-devel
# Note that the package prefix is always python3-, even if we build for 3.X
# The minimal version is for bundled provides verification script
BuildRequires: python3-rpm-generators >= 11-8
BuildRequires: pyproject-rpm-macros
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: bash-completion
@ -239,10 +240,10 @@ sed -Ei '/pytest-(cov|xdist|rerunfailures)/d' tests/requirements.txt
%build
%py3_build_wheel
export PYTHONPATH=./src/
%pyproject_wheel
%if %{with doc}
export PYTHONPATH=./src/
# from tox.ini
sphinx-build-3 -b html docs/html docs/build/html
sphinx-build-3 -b man docs/man docs/build/man -c docs/html
@ -255,7 +256,7 @@ rm -rf docs/build/html/{.doctrees,.buildinfo}
# /usr/bin/pip yet, so we install using the wheel directly.
# (This is not standard wheel usage, but the pip wheel supports it -- see
# pip/__main__.py)
%{python3} dist/%{python_wheel_name}/pip install \
%{python3} %{_pyproject_wheeldir}/%{python_wheel_name}/pip install \
--root %{buildroot} \
--no-deps \
--disable-pip-version-check \
@ -265,7 +266,7 @@ rm -rf docs/build/html/{.doctrees,.buildinfo}
--no-warn-script-location \
--no-index \
--no-cache-dir \
--find-links dist \
--find-links %{_pyproject_wheeldir} \
'pip==%{upstream_version}'
%if %{with doc}
@ -302,7 +303,7 @@ echo rpm > %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/INST
rm %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/RECORD
mkdir -p %{buildroot}%{python_wheel_dir}
install -p dist/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir}
%check