From f7056f5f8a39baea78491d9b6aacc0409a024e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 5 Aug 2024 14:22:10 +0200 Subject: [PATCH] Use %pyproject_install [skip changelog] --- python-pip.spec | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 61662ba..39df308 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -69,6 +69,9 @@ Patch: dummy-certifi.patch # this warning is juts moot. Also, the warning breaks CPython test suite. Patch: nowarn-pip._internal.main.patch +# Remove -s from Python shebang - ensure that packages installed with pip +# to user locations are seen by pip itself +%undefine _py3_shebang_s %description pip is a package management system used to install and manage software packages @@ -235,22 +238,9 @@ rm -rf docs/build/html/{.doctrees,.buildinfo} %install -# The following is similar to %%pyproject_install, but we don't have -# /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} %{_pyproject_wheeldir}/%{python_wheel_name}/pip install \ - --root %{buildroot} \ - --no-deps \ - --disable-pip-version-check \ - --progress-bar off \ - --verbose \ - --ignore-installed \ - --no-warn-script-location \ - --no-index \ - --no-cache-dir \ - --find-links %{_pyproject_wheeldir} \ - 'pip==%{upstream_version}' +export PYTHONPATH=./src/ +%pyproject_install +%pyproject_save_files -l pip %if %{with doc} pushd docs/build/man @@ -280,11 +270,6 @@ ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version} ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3 -# Make sure the INSTALLER is not pip and remove RECORD -# %%pyproject macros do this for all packages -echo rpm > %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/INSTALLER -rm %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/RECORD - mkdir -p %{buildroot}%{python_wheel_dir} install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_wheel_dir} @@ -314,9 +299,8 @@ pytest_k='not completion' %endif -%files -n python%{python3_pkgversion}-%{srcname} +%files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files} %doc README.rst -%license %{python3_sitelib}/pip-%{upstream_version}.dist-info/LICENSE.txt %if %{with doc} %{_mandir}/man1/pip.* %{_mandir}/man1/pip-*.* @@ -328,7 +312,6 @@ pytest_k='not completion' %{_bindir}/pip-3 %{_bindir}/pip%{python3_version} %{_bindir}/pip-%{python3_version} -%{python3_sitelib}/pip* %dir %{bash_completions_dir} %{bash_completions_dir}/pip3