Re: [Distutils] Twisted plugin system and Python packaging
At 04:20 PM 9/21/2011 +0200, Tristan Seligmann wrote:
If you include "twisted.plugins" in your setup.py, then this works fine with distutils "setup.py install" as well as "pip install"; setuptools "setup.py install" will install everything into an egg, which will also work due to the way __path__ is set. However, since "twisted" ends up in top_files.txt in the egg-info, "pip uninstall" will blow away your whole Twisted install when uninstalling a project shipping Twisted plugins that was installed with "pip install".
This really sounds like a bug in pip; top_level.txt is not a replacement for a proper uninstall log.
So, how should Twisted and Twisted-related projects be packaged in order to avoid these issues? Please bear in mind that the current plugin system in Twisted was first introduced around March 2005 (replacing the even older plugin system in use at the time, I believe), thus there are quite a number of users relying on this code; any changes would need to be backwards-compatible to avoid causing problems for all of the existing projects and users relying on the functionality.
I think you've answered your own question here: there *isn't* any way to package Twisted-related projects in a way that avoids the issue, due to the bug in pip. It's not Twisted's fault that pip takes shortcuts here.
On Sep 24, 2011, at 11:01 PM, P.J. Eby wrote:
This really sounds like a bug in pip; top_level.txt is not a replacement for a proper uninstall log.
Thanks. It appears that Pip's maintainers are (the teensiest bit grudgingly) coming around to this perspective as well: https://github.com/pypa/pip/issues/355#issuecomment-2182951 Hopefully we can get a solution that pretty much works everywhere, soon. -glyph
At 11:32 PM 9/24/2011 -0400, Glyph Lefkowitz wrote:
On Sep 24, 2011, at 11:01 PM, P.J. Eby wrote:
This really sounds like a bug in pip; top_level.txt is not a replacement for a proper uninstall log.
Thanks. It appears that Pip's maintainers are (the teensiest bit grudgingly) coming around to this perspective as well: https://github.com/pypa/pip/issues/355#issuecomment-2182951https://github.com/pypa/pip/issues/355#issuecomment-2182951
You may want to note that Twisted isn't the only distribution that ships partial packages that aren't namespace packages. The logilabs packages are (or at any rate were) distributed this way, with a top-level package in one distribution, and some modules (without an __init__) were shipped in other distributions. (I could be wrong, but I think the mx.* stuff works this way, too.) (These are all packages that are distutils-only, though, or have their own extensions, IIRC.)
On Sep 25, 2011, at 1:44 AM, P.J. Eby wrote:
You may want to note that Twisted isn't the only distribution that ships partial packages that aren't namespace packages. The logilabs packages are (or at any rate were) distributed this way, with a top-level package in one distribution, and some modules (without an __init__) were shipped in other distributions. (I could be wrong, but I think the mx.* stuff works this way, too.)
Thanks for that data point! It is really good to know, I'll use it to bludgeon some people with next time this issue comes up (on this list, or on some Debian bug, or whatever) ;-).
(These are all packages that are distutils-only, though, or have their own extensions, IIRC.)
You mean "extensions to distutils", or C extensions? I think Twisted qualifies for both of those, and we definitely want to remain installable without setuptools, although we do use it for one or two things if it's available now. -glyph
At 08:52 PM 9/25/2011 -0400, Glyph Lefkowitz wrote:
On Sep 25, 2011, at 1:44 AM, P.J. Eby wrote:
(These are all packages that are distutils-only, though, or have their own extensions, IIRC.)
You mean "extensions to distutils", or C extensions?
The former. The mx.* stuff has a mx_setup or some such distutils extension. Not sure about the ll.* stuff.
participants (2)
-
Glyph Lefkowitz
-
P.J. Eby