[Distutils] Disabling --single-version-externally-managed
Toshio Kuratomi
a.badger at gmail.com
Sun Sep 2 08:37:25 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Phillip J. Eby wrote:
> At 07:45 PM 9/1/2007 -0700, Toshio Kuratomi wrote:
>> pkg_resource.requires() is documented on the web page, in
>> pkg_resource.txt, and when you python setup.py install
>> - --single-version-externally-managed. __requires__ is documented...
>> nowhere. If you're willing to change documentation that says to use
>> pkg_resources.require() to use __requires__ instead then this will work
>> out perfectly. If not, we'll need to find a way to make
>> pkg_resources.require() work so that we aren't constantly explaining to
>> people that it doesn't work because upstream tells us it doesn't work
>> and we're sorry that all the official upstream documentation says
>> otherwise.
>
> As I've explained repeatedly before, your choices are to either have a
> default version, or not to have one. If you do not have one, then
> everything works as you wish, except for the fact that you must always
> explicitly require() something to use it (because there's no default).
>
> If do you have a default version, then the only way to get something
> *other* than the default version is to use __requires__ or a
> setuptools-generated script (which automatically includes __requires__).
>
>
Yes. And I'm repeating that the problem is the documentation doesn't
match the behaviour. If using __requires__ works, then the
documentation needs to mention it. Preferably, it should substitute for
all the places where pkg_resources.require() is currently highlighted as
the right way to do things. For instance, this output from easy_install::
'''
Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:
pkg_resources.require("SQLAlchemy") # latest installed version
pkg_resources.require("SQLAlchemy==0.3.10") # this exact version
pkg_resources.require("SQLAlchemy>=0.3.10") # this version or higher
'''
I realize that taken in the vacuum of that single easy_install run,
require() works. But the instructions are neglecting to tell the user
that things are more complex than that. That depending on how the other
versions of the module are installed, pkg_resources may not work at all.
Since __require__ works for this instance and for a mixture of -m and
- -s isn't it best to give users instructions that they can use everywhere?
- -Toshio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFG2lokX6yAic2E7kgRAjtcAKCw1qg4iRrQAQxeyyX8sE9WvMwMDwCbB6ZY
ZrjwE12dAxBKrEoGra2b19s=
=qjbi
-----END PGP SIGNATURE-----
More information about the Distutils-SIG
mailing list