-
Notifications
You must be signed in to change notification settings - Fork 3.1k
uninstall -nspkg.pth files installed with setup.py develop #4176
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
Comments
Is this file named after the package being uninstalled? |
I don't understand the question. Was it answered due to the example in #4213? |
Yea sorry. |
#4576 has a test for this. |
Is anyone working on a fix for this? If not, does it need to remain a release blocker? |
Well, I tagged it as a release blocker but I really don't know if it's definitely one. I just wanted to make sure that someone takes a look at this before making the release and determine if this needs to be or not and @dstufft said doing this would be fine. :) |
I can attest the error message is very confusing when such a .pth file is left behind after uninstall. I can't say if it qualifies as a release blocker though. |
As it's a new problem introduced by changes in setuptools, I think fixing it is important. I don't understand the details, but I guess the problem is that setuptools isn't properly putting the information in the RECORD file and that's why pip isn't aware of it. So I don't understand why this isn't simply a setuptools bug that the file is missing from RECORD. Maybe because as a namespace package, the file is deemed to be "shared" somehow? In which case there's a design question which need to be thought through (how do we record files that are shared between multiple packages). Although there may well be a tactical fix that pip can make to special-case the situation. I'm happy to consider this as "high priority", but if no-one is willing to step up and offer a fix, I don't think we should block pip 10 on it (after all, setuptools didn't make it a release blocker at their end :-P) |
It is not a shared file. @jaraco can probably comment on why it's reported here and not in setuptools. |
I have the same position but I don't think I mentioned it anywhere. |
Dropping release blocker status based on the above discussion. :) |
Interesting. I didn't think RECORD was used for |
I wasn't aware of anything specific for editable packages, but I'm equally working on assumption here... |
Looks like there is a special case for editable installs. https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_uninstall.py#L358 Thanks for the pointer - so this needs fixing at the pip end, I guess. |
In the absence of a PR for this, it'll probably get deferred until after pip 10. |
FTR, found a file named |
Pushing this down the road to the next release since I don't think this'd happen in time for 18.0. |
Pushing this down the road since I don't think this'd happen in time for 18.1. |
Process note - I'm not sure it's worth putting things into release milestones - it creates an expectation that we're hoping to release things in a particular version, whereas in fact calver means that we'll release with whatever's in master, regardless of what's sitting in any "release XX.Y" milestone. Dropping the milestones would save a certain amount of unnecessary admin, as well as avoiding the impression that things are "slipping". |
Agreed. I realized that and I already stopped doing it. :) |
I've created #7795 which might solve it, but have done it for manually created "RECORD" files in the first place (via a custom "develop" setuptools command). |
It does not look like setuptools creates a RECORD file for the namespace-pth files though: https://github.com/pypa/setuptools/blob/e84f616a6507ec9115fad68b221cbf5333d9d2d9/setuptools/namespaces.py#L15-L31, but removes them with Shouldn't pip maybe just run the But given the "dynamic" nature of the "develop" command it seems to make sense also calling it for uninstallation, which is important for custom / extended versions of it in particular: currently pip just assumes what setuptools is doing there for its uninstallation. |
This allows for pip to uninstall any custom files, e.g. being created with a custom "develop" setuptools command, where a `RECORD` file is created manually: with open(os.path.join(self.dist.egg_info, "RECORD"), "w") as fp: fp.write("{},,".format(custom_fname)) It might also help with uninstalling -nspkg.pth files (pypa#4176), but have not investigated/tested this.
Personally I like the idea of calling |
Using |
You're right, that doesn't sound like as good an idea anymore. Those kinds of complications and edge cases are things that would have to be sorted out as part of a standardized editable install proposal. I'm tempted to say let's not try to figure them out here and instead if this gets implemented just do the straightforward thing and implement the logic in pip. |
With the release of setuptools 31,
setup.py develop
finally should work with namespace packages. However, it's my understanding that currently when one uninstalls using pip, pip doesn't remove the -nspkg.pth file created. It probably should do so.The text was updated successfully, but these errors were encountered: