[Distutils] setup.py test doesn't honor --find-links
Tres Seaver
tseaver at palladion.com
Thu Mar 16 16:52:36 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Phillip J. Eby wrote:
> At 10:23 AM 3/14/2006 -0500, Tres Seaver wrote:
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>Can we extend the test command (deriving from easy_install, I guess,
>>instead of Command), to take the same options it does?
>
>
> I don't think that approach is a good idea, as it's more complex and isn't
> orthogonal to other setuptools features that install eggs for build
> purposes (e.g. setup_requires). It would probably be better to implement
> the "dependency_links" feature described here:
>
> http://mail.python.org/pipermail/distutils-sig/2005-October/005209.html
>
> and make it be used by the setuptools.dist.Distribution class's
> "fetch_build_egg()" method, which is used for both setup_requires and
> tests_require.
>
> I've left that feature open for a while in the hopes that it would provide
> some enterprising soul with an easy project to learn about extending
> setuptools, as it's mostly pretty shallow to implement. The only part such
> an enterprising party might need help with is the bit that touches
> easy_install; the rest should be a matter of just copying existing entry
> points defined in setuptools' setup.py.
I'm a bit lost as to the rationale for the separate metadata filee in
that post: why wouldn't we just use the 'dependency_links' attribute of
the distribution? At any rate, I'm attaching a partially-working patch.
I could get the 'dependency_links.txt' file to be created, but couldn't
figure out how to use the pkg_resources facilities for reading it while
inside 'fetch_build_eggs'. I alos ran into the problem that, since the
'test' command doesn't support the usual 'easy_install' arguments (my
original reason for posting), I couldn't control where the downloaded
packages would be installed: they went directly in my local sandbox.
In case it wasn't clear from my original post, I have the following use
case:
- Check out the "packaging bits" for a Zope egg I want to build, e.g.:
$ svn co svn+ssh://svn.zope.org/repos/main/zope.interface/trunk zi
$ cd zi
- Run the tests, first downloading and installing any dependencies
(including'test_requires'). Preferably, those dependencies should
*not* be installed into 'site-packages'; I want to verify that the
package correctly identifies all of its own dependencies, without
relying on any other environment except a "bare" virtual python:
$ /path/to/python setup.py test
...
No local packages or download links found for zope.testing
error: Could not find suitable distribution for \
Requirement.parse('zope.testing')
My original plan was to add the 'easy_install' command line args to
the 'test' command, which would have allowed:
$ /path/to/python setup.py test \
--find-links="http://download.zope.org/distribution"
Under the mechanism you redireted me to, I need to add the equivalent
URL into zi/setup.py as a 'dependency_link' argument to 'setup', and
then arrange for that value to be used as the 'find_links' value for
the 'test' command. Is that what you intended?
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEGYnE+gerLs4ltQ4RAvoNAJ0bXH1PaiSiwCrkUNX9vKcUKmZd6wCdHusa
nbxSITAWe1kk4L9e300djFA=
=YA3h
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setuptools-dependency_links.patch
Type: text/x-patch
Size: 3867 bytes
Desc: not available
Url : http://mail.python.org/pipermail/distutils-sig/attachments/20060316/595eba95/attachment.bin
More information about the Distutils-SIG
mailing list