public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/pyproject-rpm-macros] f44: Set PIP_CONFIG_FILE=/dev/null by default when invoking pip to build+install the wheel
Date: Fri, 24 Jul 2026 22:43:38 GMT	[thread overview]
Message-ID: <178493301826.1.10554037294301838268.rpms-pyproject-rpm-macros-30df8fe2179c@fedoraproject.org> (raw)

            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
 
 

                 reply	other threads:[~2026-07-24 22:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178493301826.1.10554037294301838268.rpms-pyproject-rpm-macros-30df8fe2179c@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox