-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip editable install fails with pyproject.toml, even with no setup.py import error #8986
Comments
I've encountered this problem before. My understanding of it is that it needs setuptools installed before it tries using setup.py + setup.cfg. This means you need to specfiy it as a requirement in the For ansible/ansible-builder, this patch was enough to fix it:
|
It doesn't, but PEP 517 doesn't really have a mechanism for editable installs -- so that entire chunk of pip's code does continue to expect setuptools to be available. 🤷🏽♂️ |
@pradyunsg iirc, for editable installations it falls back to the non-PEP517 approach, right? Or is it more nuanced than that? |
I don’t think there is a fallback at all. PEP 517 configuration is simply ignored entirely for an editable installation. |
In terms of avoiding other people encountering this problem, is there a way to check if the program is in the "split-brained" mode and the error was setuptools missing? If so, perhaps we could catch that and point people to documentation about this, or something like that? |
Environment
Description
A project with both
setup.py
andpyproject.toml
will error when doing an editable install viapip install -e .
with the error:I cannot find a mention of this type of error anywhere else in the issue queue, and I cannot convince myself this is correct behavior.
The build isolation causes
setuptools
to not be available, and by all means, I realize thatpyproject.toml
does not list it. However, thesetup.py
file does not require it. This error was not from runningsetup.py
, but running the custom pip commandThe venv at
/home/alancoding/repos/awx
has setuptools, but somehow with the pip subprocess build isolation, it's not available.Expected behavior
If running with
-e
, and the project is split-brained betweensetup.py
andpyproject.toml
, then it seems like it shouldn't do build isolation withpyproject.toml
to turn around and go runsetup.py
.I know that
-e
isn't supported with PEP 518, and this is only here as legacy behavior. But this looks like a regression that could be addressed by being more consistent about using the legacy behavior.If I temporarily delete
pyproject.toml
, then it works like a charm. I think that behavior should be the expectation.How to Reproduce
If you see any issue in how these projects are structured, then I'm happy to make changes, but I have replicated the error I described with both of:
We have
pyproject.toml
in order to adopt the latest stuff, but we have to includesetup.py
for compatibility, for RHEL in particular. For ansible/ansible-builder at least, we didn't writesetup.py
, but generated it from the library dephell, and you can view their template here:https://github.com/dephell/dephell/blob/657b25a0caac5c61f9b9bf5ec85453b9745a1adb/dephell/converters/setuppy.py#L48
The specific purpose of this template is to produce a compatibility-oriented
setup.py
script in a project which is otherwise using the new standard.In either of these projects, the steps to reproduce is
pip install -e .
, from the project root.Output
Here's the final part of the verbose output for ansible/ansible-builder:
https://gist.github.com/AlanCoding/dab97a4a84e14911fb1f7c1087e437b2
The skip logs were too numerous to include the full output, so the beginning is truncated.
The text was updated successfully, but these errors were encountered: