public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pyproject-rpm-macros] f44: Set PIP_CONFIG_FILE=/dev/null by default when invoking pip to build+install the wheel
@ 2026-07-24 22:43 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-07-24 22:43 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/pyproject-rpm-macros
            Branch : f44
            Commit : 30df8fe2179cbe09fb7b06e303fc1c5959358f0d
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2026-07-24T22:00:01+02:00
            Stats  : +5/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/pyproject-rpm-macros/c/30df8fe2179cbe09fb7b06e303fc1c5959358f0d?branch=f44

            Log:
            Set PIP_CONFIG_FILE=/dev/null by default when invoking pip to build+install the wheel

User pip configuration (e.g. require-virtualenv = true in ~/.pip/pip.conf)
can interfere with the wheel build, causing unexpected failures.
Since %pyproject_wheel runs pip in the RPM build environment,
user-level pip settings are never appropriate.

However, if the packager sets PIP_CONFIG_FILE in spec,
it still takes precedence.

Assisted-By: Claude Opus 4.6

---
diff --git a/macros.pyproject b/macros.pyproject
index d877475..46b6289 100644
--- a/macros.pyproject
+++ b/macros.pyproject
@@ -111,6 +111,7 @@ if [ -z "$specifier" ]; then
   echo 'ERROR: %%%%pyproject_install found no wheel in %%%%{_pyproject_wheeldir} %{_pyproject_wheeldir}' >&2
   exit 1
 fi
+PIP_CONFIG_FILE="${PIP_CONFIG_FILE:-/dev/null}" \
 TMPDIR="%{_pyproject_builddir}" %{__python3} -m pip install --root %{buildroot} --prefix %{_prefix} --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} $specifier
 if [ -d %{buildroot}%{_bindir} ]; then
   %py3_shebang_fix %{buildroot}%{_bindir}/*

diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec
index cb49fc3..94633ba 100644
--- a/pyproject-rpm-macros.spec
+++ b/pyproject-rpm-macros.spec
@@ -183,6 +183,7 @@ export HOSTNAME="rpmbuild"  # to speedup tox in network-less mock, see rhbz#1856
 - getopt: Fix global macro clobbering with save/restore stack
 - %%pyproject_extras_subpkg: Add long options support
 - %%pyproject_extras_subpkg: Make -D/--dist-name mutually exclusive with -i/-f/-F
+- Set PIP_CONFIG_FILE=/dev/null by default when invoking pip to build the wheel
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.23.0-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

diff --git a/pyproject_wheel.py b/pyproject_wheel.py
index 55e35e6..186ba36 100644
--- a/pyproject_wheel.py
+++ b/pyproject_wheel.py
@@ -1,4 +1,5 @@
 import argparse
+import os
 import sys
 import subprocess
 
@@ -56,7 +57,8 @@ def build_wheel(*, wheeldir, stdout=None, config_settings=None):
         *get_config_settings_args(config_settings),
         '.',
     )
-    cp = subprocess.run(command, stdout=stdout)
+    env = {'PIP_CONFIG_FILE': '/dev/null', **os.environ}
+    cp = subprocess.run(command, env=env, stdout=stdout)
     return cp.returncode
 
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-24 22:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24 22:43 [rpms/pyproject-rpm-macros] f44: Set PIP_CONFIG_FILE=/dev/null by default when invoking pip to build+install the wheel 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox