Skip to content

pip should ignore [install] no-deps = true in pip.conf when setting up isolated build environment. #11275

Open
@anntzer

Description

@anntzer

Description

AFAICT, having

[install]
no-deps = true

in one's pip.conf (which is my case as I prefer manually resolving dependencies (or rather with some custom scripts) in my work environment) leads to dependencies also not being installed when setting up the isolated build environment (i.e. the pip install calls when setting up that environment will also honor no-deps = true), but that makes the build fail as build-time dependencies will fail to import due to missing their own dependencies, and that's not something I (as a user) can manually fix, as the entire build-time environment only exists for the duration of the invocation of pip.

Expected behavior

Setting up the build environment should ignore [install] no-deps = true. Or, if that sounds too special-cased, perhaps there can be some way to say "nested pip calls during the setup of the build environment should use a different pip.conf".

To be clear, I understand that [install] no-deps = true makes me responsible for handling dependencies myself, but in the case of build-time nested dependencies in an isolated build environment, there is no time interval where I can actually do that.

pip version

22.1.2

Python version

3.10

OS

Arch Linux

How to Reproduce

In a clean venv and empty tmpdir:

$ printf '[install]\nno-deps = true' > pip.conf
$ PIP_CONFIG_FILE=pip.conf pip install -v --no-binary=scikit-image scikit-image

scikit-image has a build-time dependency on pythran, which has an install-requires on gast; this install-requires is not honored.

Output

Using pip 22.1.2 from /tmp/testenv/lib/python3.10/site-packages/pip (python 3.10)
Collecting scikit-image
  Downloading scikit-image-0.19.3.tar.gz (22.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.2/22.2 MB 10.1 MB/s eta 0:00:00

<elided>

  Installing collected packages: pythran, wheel, setuptools, packaging, numpy, Cython
  Successfully installed Cython-0.29.30 numpy-1.21.4 packaging-21.3 pythran-0.11.0 setuptools-59.4.0 wheel-0.37.1
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Traceback (most recent call last):

<elided>

    File "/tmp/pip-build-env-nosq_n6m/overlay/lib/python3.10/site-packages/pythran/passmanager.py", line 14, in <module>
      import gast as ast
  ModuleNotFoundError: No module named 'gast'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /tmp/testenv/bin/python /tmp/testenv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpng4ao8h5
  cwd: /tmp/pip-install-eos0zrxs/scikit-image_43ca98b65312486da4e3637012339511
  Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions