Skip to content

pip config regression in 25.2 #13548

@anlambert

Description

@anlambert

Description

I work on a large Python project split into multiple Python packages, each having its own git repository.

We use a dedicated virtual environment for development where each package is installed in editable mode.

As we use the mypy tool for type checking, we are forced to use the strict editable install as it is the only way for mypy to properly work with editable installs.

In order to setup strict editable installs by default, we use the following command to configure pip in our virtual environment (executed by that script populating the venv):

pip config --site set install.config-settings editable_mode=strict

Prior pip 25.2, the packages could be successfully installed in strict editable mode by default by executing pip install -e <package_dir>.

Now the following error is reported when attempting to install a package in editable mode:

Building editable for swh.web (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running editable_wheel
      creating /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info
      writing /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/requires.txt
      writing top-level names to /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/top_level.txt
      writing manifest file '/tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      adding license file 'AUTHORS'
      writing manifest file '/tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh.web.egg-info/SOURCES.txt'
      creating '/tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh_web-0.15.1.dev3+g07c7e2a80.dist-info'
      creating /tmp/pip-wheel-b85w6z3x/.tmp-_v8j38uq/swh_web-0.15.1.dev3+g07c7e2a80.dist-info/WHEEL
      running build_py
      running egg_info
      creating /tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info
      writing /tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/PKG-INFO
      writing dependency_links to /tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/dependency_links.txt
      writing requirements to /tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/requires.txt
      writing top-level names to /tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/top_level.txt
      writing manifest file '/tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      adding license file 'AUTHORS'
      writing manifest file '/tmp/tmpuc5vcbzn.build-temp/swh.web.egg-info/SOURCES.txt'
      error: Invalid editable mode: "['strict', 'strict']". Try: 'strict'.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for swh.web
  Building editable for swh.icinga_plugins (pyproject.toml) ... error
  error: subprocess-exited-with-error

I managed to identify the commit that introduced the regression after a quick git bisect session, it is 9f082bc.

Expected behavior

Previous behavior should be restored: setting strict editable install by default with pip config should not trigger an error when executing pip install -e <package_dir>.

pip version

25.2

Python version

3.12

OS

Ubuntu 24.04

How to Reproduce

The following script is sufficient to reproduce the issue:

cd /tmp
python3 -m venv test_venv
. test_venv/bin/activate
pip install --upgrade pip
pip config --site set install.config-settings editable_mode=strict
git clone https://gitlab.softwareheritage.org/swh/devel/swh-model
pip install -e swh-model

Output

Requirement already satisfied: pip in ./test_venv/lib/python3.12/site-packages (24.0)
Collecting pip
  Using cached pip-25.2-py3-none-any.whl.metadata (4.7 kB)
Using cached pip-25.2-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-25.2
Writing to /tmp/test_venv/pip.conf
fatal: destination path 'swh-model' already exists and is not an empty directory.
Obtaining file:///tmp/swh-model
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting attrs>=21.3.0 (from swh.model==8.3.0)
  Using cached attrs-25.3.0-py3-none-any.whl.metadata (10 kB)
Collecting attrs_strict>=0.0.7 (from swh.model==8.3.0)
  Using cached attrs_strict-1.0.1-py3-none-any.whl.metadata (6.3 kB)
Collecting deprecated (from swh.model==8.3.0)
  Using cached Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB)
Collecting hypothesis (from swh.model==8.3.0)
  Using cached hypothesis-6.138.2-py3-none-any.whl.metadata (5.6 kB)
Collecting iso8601 (from swh.model==8.3.0)
  Using cached iso8601-2.1.0-py3-none-any.whl.metadata (3.7 kB)
Collecting python-dateutil (from swh.model==8.3.0)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting typing_extensions (from swh.model==8.3.0)
  Using cached typing_extensions-4.14.1-py3-none-any.whl.metadata (3.0 kB)
Collecting wrapt<2,>=1.10 (from deprecated->swh.model==8.3.0)
  Using cached wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.4 kB)
Collecting sortedcontainers<3.0.0,>=2.1.0 (from hypothesis->swh.model==8.3.0)
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl.metadata (10 kB)
Collecting six>=1.5 (from python-dateutil->swh.model==8.3.0)
  Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Using cached attrs-25.3.0-py3-none-any.whl (63 kB)
Using cached attrs_strict-1.0.1-py3-none-any.whl (14 kB)
Using cached Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB)
Using cached wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (88 kB)
Using cached hypothesis-6.138.2-py3-none-any.whl (530 kB)
Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Using cached iso8601-2.1.0-py3-none-any.whl (7.5 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached six-1.17.0-py2.py3-none-any.whl (11 kB)
Using cached typing_extensions-4.14.1-py3-none-any.whl (43 kB)
Building wheels for collected packages: swh.model
  Building editable for swh.model (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building editable for swh.model (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      /tmp/pip-build-env-_glyhgw3/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU General Public License v3 (GPLv3)
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        dist._finalize_license_expression()
      /tmp/pip-build-env-_glyhgw3/overlay/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: GNU General Public License v3 (GPLv3)
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running editable_wheel
      creating /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info
      writing /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/dependency_links.txt
      writing entry points to /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/entry_points.txt
      writing requirements to /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/requires.txt
      writing top-level names to /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/top_level.txt
      writing manifest file '/tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      adding license file 'AUTHORS'
      writing manifest file '/tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh.model.egg-info/SOURCES.txt'
      creating '/tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh_model-8.3.0.dist-info'
      creating /tmp/pip-wheel-o6ddd3na/.tmp-jst5gtwa/swh_model-8.3.0.dist-info/WHEEL
      running build_py
      running egg_info
      creating /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info
      writing /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/PKG-INFO
      writing dependency_links to /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/dependency_links.txt
      writing entry points to /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/entry_points.txt
      writing requirements to /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/requires.txt
      writing top-level names to /tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/top_level.txt
      writing manifest file '/tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/SOURCES.txt'
      adding license file 'LICENSE'
      adding license file 'AUTHORS'
      writing manifest file '/tmp/tmpxctxjm1x.build-temp/swh.model.egg-info/SOURCES.txt'
      error: Invalid editable mode: "['strict', 'strict']". Try: 'strict'.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for swh.model
Failed to build swh.model
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> swh.model

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: configurationConfiguration management and loadingtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions