-
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 cannot uninstall an editable install in some cases #10659
Comments
This is the real problem, pip installs the package with the name Not sure if this |
/cc @sbidoul Looks like pip is trying to install a pyproject.toml based project via |
What happens here, I think, is:
I don't think there is much we can do in pip. I'd recommend two things:
|
@sbidout I have a name configured in my pyproject.toml |
But setuptools does not read pyproject.toml. So until poetry supports PEP
660, you need to configure setuptools if you want editable installs.
Le dim. 14 nov. 2021 à 15:24, Neil Girdhar ***@***.***> a
écrit :
… @sbidout I have a name configured in my pyproject.toml
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10659 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFI625XLZC54BLEX43MCLLUL7BARANCNFSM5H7XLITQ>
.
|
Poetry does support PEP 660. |
When I pip install poetry_core, I get version 1.0.7. Which, at first sight, does not have |
@sbidoul Good catch. So shall I wait for the poetry release and try again? (Incidentally, which project is at fault given that poetry doesn't support editable installs?) |
If you want editable install before poetry releases the only way is to configure setuptools in setup.cfg or setup.py. As to what needs to change to avoid the surprising behavior you noticed, I think the only possible place is setuptools which should reject projects with no name (although they might have reasons to install UNKNOWN, I don't know). |
And if you don't need editable installs now and can wait until the poetry release, I suggest you rename |
Thanks. I'm just asking which project should be giving the error now though. If I don't change anything, I should still be getting an error, right? Where should that be coming from? |
@NeilGirdhar As I said above, setuptools, IMHO. |
Thanks, sorry I missed that 😊 |
Closing as we have not identified anything actionable for pip. |
I do think there's something pip could do here. If the pyproject.toml specifies a build backend, it should not invoke setuptools. In fact I'd go further and say that pip should not fall back to building with Setuptools unless there's a Maybe that's not possible, given current assumptions (projects are allowed to specify one backend, but expect to use setuptools as a fallback for editable). There's something else pip could do - if it's going to install a project as editable using setuptools, it should use the name that Setuptools resolves for the package, regardless what pip might expect by reading pyproject.toml. |
Setuptools handle all the installation when being used to install an editable, and the project name is resolved by only setuptools, pip does not do anything here. I agree with your earlier point there’s something pip can do to make things more sensible though. It’s true that a project can be |
This would not help with this specific issue, though, as the OP's example does have a build backend declared. So I'd argue this should be the topic of an other issue, if people want that. Also noting that I'd rather be in favor of dropping support for setup.cfg-only projects than going further down that hole with more setuptools-specific code. It was a mistake to support that, IMO. |
I'm just curious, but were jaraco's suggestions unreasonable?
Am I wrong that either of those suggestions would have prevented my problem by causing an immediate error (since the backend I chose doesn't yet support editable installs)? |
@NeilGirdhar both would be compatibility-breaking changes for pip, unfortunately. |
Would emitting a warning be compatibility-breaking? |
No, but it’ll be the first step toward changing our behaviour. |
But what should we warn about exactly, and can we do it without building more setuptools knowledge into pip ? |
Description
When a project that contains only pyproject.toml is installed in editable mode, pip cannot uninstall it.
pip version
21.3.1
Python version
3.9
OS
Ubuntu
How to Reproduce
This uninstalls it:
Also, for some reason, the egg in ~/tjax is called "UNKNOWN.egg-info", but pyproject.toml clearly specifies the name "tjax".
Code of Conduct
The text was updated successfully, but these errors were encountered: