Using setuptools

David Wolever wolever at cs.toronto.edu
Thu Jun 26 06:42:01 PDT 2008


On 26-Jun-08, at 9:26 AM, Ivan Glushkov wrote:
> I've read requirements of ez_setup.py:
> "You will need at least Python 2.3.5, or if you are on a 64-bit
> platform, Python 2.4.".
> ditrack requires Python 2.3, so we should either set the minimal
> version of Python to 2.4 (see our  discussion about this in
> http://lists.ditrack.org/pipermail/dev/2007-April/000210.html) or
> don't use setuptools.
> I suppose we should require Python 2.4, it seems to me that now it's
> hard to find computers to such old version as 2.3. Though, i might be
> wrong.
> And by the way, rejection of requirement of python 2.3 will even
> simplify our code (see DITrack/ThirdParty/Python/string.py).
The only thing I can think of that has Python 2.3 these days is Mac  
OS 10.4 comes pre-loaded with it... But it's really easy to get 2.5,  
and I would be willing to bet that _most_ developers who are using  
OSX already have 2.5 because fewer and fewer things support 2.3 these  
days.

>>  There are two reasons I'd prefer using setuptools:
>>  0) `setup.py develop` is _incredibly_ useful
>>  1) To get on the PyPi (http://pypi.python.org/pypi), so DT can be  
>> installed
>> with easy_install and listed in a package's dependencies (so, for  
>> example,
>> when someone runs `setup.py develop`, DT gets installed  
>> automatically,
>> making it that much easier to access the project's issue database).
>
> We're already on the PyPi:
> http://pypi.python.org/pypi/DITrack/0.7
D'oh!
Well, thanks for putting up with my ignorance.
I'd tried to `easy_install DITrack` in the past, which is what I was  
basing my assertion on... I guess I must have fat fingered it or  
something.

> And please, explain once more about "setup.py develop".
> I've found some information about it on
> http://peak.telecommunity.com/DevCenter/EasyInstall
> Have you said about it? Or not?
Basically `setup.py develop` installs installs the package, but  
instead of putting in the real scripts/egg, it creates skeleton  
scripts that are links to the real ones in the development  
environment.  For example:
[wolever at wuntop] /tmp cat `which dt`
#!/Library/Frameworks/Python.framework/Versions/2.5/Resources/ 
Python.app/Contents/MacOS/Python
# EASY-INSTALL-DEV-SCRIPT: 'DITrack==0.9-alpha','dt'
__requires__ = 'DITrack==0.9-alpha'
from pkg_resources import require; require('DITrack==0.9-alpha')
del require
__file__ = '/Users/wolever/code/software/ditrack/dt'
execfile(__file__)
And the egg in $PYTHONPATH looks similar.

Basically, it means you don't need to fiddle with $PATH or `ln -s`  
while you're working on a package.

>>  (but, if that's the case, could someone at least document how to  
>> develop on
>> DT?)
> Vlad? :)



More information about the Dev mailing list