Open domdfcoding opened 2 years ago
I can still reproduce this with pip 22.3.1 and setuptools 65.6.3
Hmm this looks like a setuptools issue, but some investigation is needed to figure out a reproduction with bare setuptools. I have a suspicion this may be related to cwd.
Description
When the current working directory contains a
pyproject.toml
filepip
may fail to install (or build a wheel for) source packages. Setuptools tries to parse thepyproject.toml
file from the working directory, but I'm not sure why. Because the configuration is for a different backend (and invalid for setuptools) setuptools raises an exception. The issue only seems to crop up when installing build dependencies to build wheels from sdists, but the build dependencies themselves can be wheels.This worked correctly before pip 22.2. I have tracked the issue to 00e5adf2aa4223e37a191a454300d888af5687f5 (part of #11262).
I can narrow the issue down to the command (which pip invokes internally):
/tmp/setuptools-issue
is my virtualenv. The package being installed doesn't matter.The crux of the issue seems to be that pip calls
parse_config_files()
in_distutils.py
, which triggers setuptools to unnecessarily parse thepyproject.toml
file.I don't think this is an issue with setuptools, as it occurs regardless of the setuptools version, but if I uninstall setuptools or set
SETUPTOOLS_USE_DISTUTILS=stdlib
the issue goes away entirely, so there's some strange interaction between pip and setuptools' version of distutils going on.Expected behavior
Pip correctly installs the package, or builds the wheel, as requested.
pip version
22.2.2
Python version
PyPy 3.7
OS
Ubuntu 20.04
How to Reproduce
pyproject.toml
file with the following content:pip wheel msgpack==1.0.4
I can't reproduce on CPython, only on PyPy
Output
Code of Conduct