[Distutils] EasyInstall --> distutils command + setuptools enhancements?
Phillip J. Eby
pje at telecommunity.com
Wed Jun 8 22:25:42 CEST 2005
At 01:20 PM 6/8/2005 -0500, Ian Bicking wrote:
>Phillip J. Eby wrote:
>>>I'm still not clear. Do you mean you intend people to do:
>>>
>>> python setup.py install_depends
>>
>>That wasn't what I had in mind, although now that you mention it, it
>>sounds kind of handy. Not so much that people would type it directly, as
>>that folks who don't want their users to have to install EasyInstall,
>>could use it as part of their build process.
>>Hm. That's actually a fantastic idea. Thanks! :)
>
>Um, okay ;) It seems a little strange to me, but I suppose it does solve
>the bootstrapping problem. Well, not "solve", but for instance I can just
>keep (or update) the code in Paste's setup.py to fetch setuptools and add
>it to sys.path, though that code does feel a bit crufty, since it's never
>going to be a very robust installation process.
We could solve that a little better by creating an 'ez_boot' module or some
such, for people to use in their setup scripts. You'd just do "import
ez_boot" in your setup script before trying to import setuptools, and it
would do the job of stuff like:
REQUIRED_VERSION="setuptools>=0.5a"
try:
import pkg_resources
except ImportError:
download_latest_setuptools()
add_setuptools_to_sys_path()
set_self_installation_flag()
else:
try:
pkg_resources.require(REQUIRED_VERSION)
except pkg_resources.VersionConflict:
ask_user_to_upgrade_and_restart()
Where the functions of course have to be defined with something
sane. :) Oh, and the self-installation flag would basically tell
setuptools it's bootstrapping, and it should install itself as if it were a
dependency of the package when you install it. That is, when you run
'setup.py install' for the containing package, it'll also install the
setuptools egg, thereby avoiding the need for any future packages to do the
download.
More information about the Distutils-SIG
mailing list