Expressing a dependancy on ElementTree
Hello everyone, I have a library that depends on ElementTree and needs to support both Python2.4 and Python2.5 style inclusion of the library. In Python2.4, it's a standalone package and can be fetched by "elementtree>=1.2". In Python2.5, it's integrated into the standard library as xml.etree. If I pass "elementtree>=1.2.6" in install_requires, setuptools downloads the Python2.4 standalone version of the package under Python2.5. Any way I can express a dependency on elementtree if and only if I'm installing into 2.4? -- Ross Vandegrift ross@kallisti.us "If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher." --Woody Guthrie
At 11:04 AM 11/7/2008 -0500, Ross Vandegrift wrote:
Hello everyone,
I have a library that depends on ElementTree and needs to support both Python2.4 and Python2.5 style inclusion of the library.
In Python2.4, it's a standalone package and can be fetched by "elementtree>=1.2". In Python2.5, it's integrated into the standard library as xml.etree.
If I pass "elementtree>=1.2.6" in install_requires, setuptools downloads the Python2.4 standalone version of the package under Python2.5.
Any way I can express a dependency on elementtree if and only if I'm installing into 2.4?
Have your setup.py check what version it's running under, and declare the right dependency (or lack thereof). This is really the only way to deal with things that are bundled in the stdlib, at least until such time as the stdlib includes .egg-info for bundled packages.
On Fri, Nov 07, 2008 at 12:29:30PM -0500, Phillip J. Eby wrote:
Have your setup.py check what version it's running under, and declare the right dependency (or lack thereof). This is really the only way to deal with things that are bundled in the stdlib, at least until such time as the stdlib includes .egg-info for bundled packages.
Okay - I didn't think of that. Not such a terrible solution :) -- Ross Vandegrift ross@kallisti.us "If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher." --Woody Guthrie
participants (2)
-
Phillip J. Eby
-
Ross Vandegrift