[Distutils] Two problems with setuptools

Phillip J. Eby pje at telecommunity.com
Fri Dec 21 15:56:25 CET 2007

At 03:22 PM 12/21/2007 +0300, Dmitry Vasiliev wrote:
>Today I've encountered the two problems related (?) to setuptools
>(version 0.6c6 on Ubuntu Linux):
>1. For tests and install my package requires the same packages so I write:
>     setup(
>         ...
>         tests_require=["Package1", "Package2"],
>         install_requires=["Package1", "Package2"],
>         )
>It seems OK but the problem arrives if I want to test package (python
>setup.py test) and then install it (python setup.py install). At the
>test phase the required packages will be downloaded and placed in the
>current directory. But at the install phase it seems setuptools will be
>fooled by the previously downloaded packages and doesn't install them

This is a known bug and not an easy one to fix, which is a big part 
of why it's not fixed yet.  :(

>2. For my setup I need customize 'install_scripts' and 'install_data'
>commands. I've placed my customized commands in a separate package,
>create lazily populated dict-like object which import desired modules by
>request and write:
>     setup(
>         ...
>         cmdclass=aLazilyPopulatedDictLikeObject,
>         setup_requires=["Package"],
>         )
>It works fine except the case when I want to place some options in
>setup.cfg. For 'install_data' it works as expected, but for
>'install_scripts' it seems the configuration parses before the required
>package will be downloaded and my additional options for
>'install_scripts' doesn't work.

I think you should post your actual code here.  As far as I can tell, 
setuptools installs the setup_requires eggs before any configuration 
parsing can happen.  I would suspect something is wrong with either 
your setup_requires or your "lazily-populated dictlike object".

More information about the Distutils-SIG mailing list