[tahoe-lafs-trac-stream] [Tahoe-LAFS] #657: "python ./setup.py test" rebuilds packages

Tahoe-LAFS trac at tahoe-lafs.org
Sat Mar 26 23:21:56 UTC 2016


#657: "python ./setup.py test" rebuilds packages
---------------------------+------------------------
     Reporter:  zooko      |      Owner:  zooko
         Type:  defect     |     Status:  closed
     Priority:  minor      |  Milestone:  1.11.0
    Component:  packaging  |    Version:  1.3.0
   Resolution:  fixed      |   Keywords:  setuptools
Launchpad Bug:             |
---------------------------+------------------------
Changes (by warner):

 * status:  assigned => closed
 * resolution:   => fixed
 * milestone:  eventually => 1.11.0


Old description:

> If you build with {{{python ./setup.py build}}}, it will automatically
> build required libraries such as pycryptopp.  On Zandr's NAS device,
> building pycryptopp takes about an hour.  Then if you test with {{{python
> ./setup.py test}}}, it will rebuild pycryptopp *again*.  I investigated
> and I see that this is because the initial {{{build}}} puts the resulting
> package into {{{./support/lib/python2.5/site-packages}}}, but the
> {{{test}}} puts it into the current working directory.  So a good fix
> would be to configure it so that the {{{test}}} step uses
> {{{./support/}}} as its "target directory".
>
> You can work-around this issue by installing with {{{python ./setup.py
> install}}}, which will copy all libraries such as pycryptopp into your
> system directory (e.g. {{{/usr/lib/python2.5/site-packages}}}, or by
> manually prepending the {{{test}}} step with
> {{{PYTHONPATH=./support/lib/python2.5/site-packages}}}.
>
> (Note that if you install with {{{python ./setup.py install}}} then it is
> *very easy to uninstall*.  All you do is {{{/bin/rm -rf}}} the *one* item
> that got added into your {{{/usr/lib/python2.5/site-packages/}}}
> directory for each library that got installed.  For example, for
> pycryptopp that item is named {{{pycryptopp-$VERSION_NUMBER-
> py2.5.egg}}}.)

New description:

 If you build with {{{python ./setup.py build}}}, it will automatically
 build required libraries such as pycryptopp.  On Zandr's NAS device,
 building pycryptopp takes about an hour.  Then if you test with {{{python
 ./setup.py test}}}, it will rebuild pycryptopp *again*.  I investigated
 and I see that this is because the initial {{{build}}} puts the resulting
 package into {{{./support/lib/python2.5/site-packages}}}, but the
 {{{test}}} puts it into the current working directory.  So a good fix
 would be to configure it so that the {{{test}}} step uses {{{./support/}}}
 as its "target directory".

 You can work-around this issue by installing with {{{python ./setup.py
 install}}}, which will copy all libraries such as pycryptopp into your
 system directory (e.g. {{{/usr/lib/python2.5/site-packages}}}, or by
 manually prepending the {{{test}}} step with
 {{{PYTHONPATH=./support/lib/python2.5/site-packages}}}.

 (Note that if you install with {{{python ./setup.py install}}} then it is
 *very easy to uninstall*.  All you do is {{{/bin/rm -rf}}} the *one* item
 that got added into your {{{/usr/lib/python2.5/site-packages/}}} directory
 for each library that got installed.  For example, for pycryptopp that
 item is named {{{pycryptopp-$VERSION_NUMBER-py2.5.egg}}}.)

--

Comment:

 We've removed the `setup.py test` command (which was an alias for "build a
 bunch of stuff and then run `trial`"). And we've switched to `tox` for
 running unit tests, where our `tox.ini` just runs `trial` in its
 virtualenv.

 So I think we can close this out now.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/657#comment:8>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list