Setuptools install_requires quirk

Mon 03 November 2008

It's interesting that having "dev " version packages in the install_requires list will fail.

Say for example, if you do:

from setuptools import setup
setup(
...
install_requires=["Pylons==dev"],
...
)

It won't work:

Installed d:\python25\lib\site-packages\pylons-0.9.7rc3dev_20081103-py2.5.egg
Reading http://www.pylonshq.com/download/0.9.7
error: Could not find required distribution Pylons==dev

I imagine it would match if the package would literally have the version "dev".

One solution is to change the install_requires to ["Pylons==dev,!=foo"] or some other bogus version to match whatever is downloaded for the dev version. ">=0.1.2.3 " will match for packages that don't have tagged versions (won't work for example for Pylons "0.9.7beta3dev-20080422").

EDIT: Looks like I was wrong. having "!=foo" will work if you already have the package installed but will fail to find the dev package when downloading. Having ">=0.9.7" in the requirements will not work because "0.9.7beta3dev-20080422" is considered a lower version (prerelease to the final 0.9.7). A solution would be having a requirement like ">=0.9.7a". "a" will be lower than "beta3dev-20080422".

This entry was tagged as python setuptools

blog comments powered by Disqus