From 06ee3919932cc437f622c2c2d4971c27851b81b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 20 Jul 2020 17:36:12 +0200 Subject: [PATCH] Add --no-index --no-warn-script-location pip options to %pyX_install_wheel --no-index saves a ~1 minute timeout of pip possibly checking if there is a newer pip version (in mock with disabled network). --no-warn-script-location removes a bogus warning that says: WARNING: The scripts easy_install and easy_install-3.9 are installed in '/builddir/build/BUILDROOT/python-setuptools-49.2.0-1.fc33.x86_64/usr/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. --- macros.python | 2 +- macros.python2 | 2 +- macros.python3 | 2 +- python-rpm-macros.spec | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/macros.python b/macros.python index 85c1896..ddc737b 100644 --- a/macros.python +++ b/macros.python @@ -42,7 +42,7 @@ } %py_install_wheel() %{expand:\\\ - %{__python} -m pip install -I dist/%{1} --root %{buildroot} --no-deps + %{__python} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location rm -rfv %{buildroot}%{_bindir}/__pycache__ for distinfo in %{buildroot}%{python_sitelib}/*.dist-info %{buildroot}%{python_sitearch}/*.dist-info; do if [ -f ${distinfo}/direct_url.json ]; then diff --git a/macros.python2 b/macros.python2 index 201f2bd..2ebec9f 100644 --- a/macros.python2 +++ b/macros.python2 @@ -47,7 +47,7 @@ } %py2_install_wheel() %{expand:\\\ - %{__python2} -m pip install -I dist/%{1} --root %{buildroot} --no-deps + %{__python2} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location rm -rfv %{buildroot}%{_bindir}/__pycache__ for distinfo in %{buildroot}%{python2_sitelib}/*.dist-info %{buildroot}%{python2_sitearch}/*.dist-info; do if [ -f ${distinfo}/direct_url.json ]; then diff --git a/macros.python3 b/macros.python3 index 691e035..42e7143 100644 --- a/macros.python3 +++ b/macros.python3 @@ -40,7 +40,7 @@ } %py3_install_wheel() %{expand:\\\ - %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --no-deps + %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location rm -rfv %{buildroot}%{_bindir}/__pycache__ for distinfo in %{buildroot}%{python3_sitelib}/*.dist-info %{buildroot}%{python3_sitearch}/*.dist-info; do if [ -f ${distinfo}/direct_url.json ]; then diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index e476166..b0b2678 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -112,6 +112,7 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ - https://fedoraproject.org/wiki/Changes/PythonMacroError - Make %%python macros more consistent with %%python3 macros - Define %%python_platform (as a Python version agnostic option to %%python3_platform) +- Add --no-index --no-warn-script-location pip options to %%pyX_install_wheel * Wed Jul 08 2020 Miro HronĨok - 3.9-5 - Introduce %%python_extras_subpkg