[Pyrex] Strange EGG behaviour (Re: ANN: Pyrex 0.9.6)

Phillip J. Eby pje at telecommunity.com
Mon Oct 8 13:39:11 CEST 2007


Here's what's happening.  easy_install imports Pyrex when it imports 
setuptools.  The Pyrex setup.py then gets its version by importing 
Pyrex.Compiler.Version...  which gets the *installed* Pyrex version 
number, not the to-be-built version number.  So you now have an 
installed Pyrex 0.9.6.1 that thinks its version number is 0.9.5.1a.

In general, importing the to-be-installed package from inside a 
setup.py is an antipattern, and not just for this specific problem.

You can fix your installation by using "easy_install -m Pyrex", 
followed by "easy_install --upgrade Pyrex".  The first command will 
take Pyrex off of sys.path, which will keep it from being imported 
when you rebuild it.

At 01:11 PM 10/8/2007 +0200, Jesus Cea wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Look at the 0.9.5.1a references:
>
>"""
>[root at tesalia /]# easy_install --upgrade pyrex
>Searching for pyrex
>Reading http://pypi.python.org/simple/pyrex/
>Couldn't retrieve index page for 'pyrex'
>Scanning index of all packages (this may take a while)
>Reading http://pypi.python.org/simple/
>Reading http://pypi.python.org/simple/Pyrex/
>Reading http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
>Best match: Pyrex 0.9.6.1
>Downloading
>http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/Pyrex-0.9.6.1.tar.gz
>Processing Pyrex-0.9.6.1.tar.gz
>Running Pyrex-0.9.6.1/setup.py -q bdist_egg --dist-dir
>/tmp/easy_install-GsQURr/Pyrex-0.9.6.1/egg-dist-tmp-Gpzl0n
>zip_safe flag not set; analyzing archive contents...
>Pyrex.Compiler.Scanning: module references __file__
>Pyrex 0.9.5.1a is already the active version in easy-install.pth
>Installing pyrexc script to /usr/local/bin
>
>Installed /usr/local/lib/python2.5/site-packages/Pyrex-0.9.5.1a-py2.5.egg
>Processing dependencies for pyrex
>Finished processing dependencies for pyrex
>"""




More information about the Pyrex mailing list