[Pyrex] New Distutils implementation for Pyrex.

Billy G. Allie bill.allie at defiant.mug.org
Sat Aug 4 05:41:15 CEST 2007


Stefan Behnel wrote:
> Hi,
>
> Billy G. Allie wrote:
>   
>> I've implesmentd a new version of
>> buld_ext.py and created a version of core.py and extension.py.
>>     
>
> first thing I noticed when running a patched Cython: setuptools break. They
> already patch into distutils, so the patching in your code doesn't work. I
> would prefer doing without changes to core.py and extensions.py. AFAICT, this
> removes the support for configuring import directories at the Extension level.
>
> Alternatively, we could also import things from setuptools first and only fall
> back to distutils. However, this would bug people who have setuptools
> installed and want to build with distutils (for whatever reason, don't know
> how common that is).
>
> I'll take a deeper look into this.
>
> Stefan
>   
Stefan,

I've looked at the setuptools source. Since setuptools is importing 
Pyrex.Distutils to perform work, setuptools will have to be patched to 
work with the new code. From my initial walkthrough of the code (by no 
meas through), it appeas that the only change would be to change 
occurances of 'distutils.core' to 'Pyrex.Distutils.core', wrapped in a 
try ... except statement. For example:

    try:
    from Pyrex.Distutils.core import Extension
    except ImportError:
    from distutils.core import Extension
    -- or --
    try:
    import Pyrex.Distutils.core
    except ImportError:
    import distutils.core

The files that would have to change are:

    command/upload.py
    command/easy_install.py
    dist.py
    extension.py
    __init__.py
    package_index.py
    tests/__init__.py

Extension is always importted from core, so with the change stated above 
it will always get the correct Extension class.
build_ext is already imported from Pyrex.Distutils.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20070804/d6410c96/attachment.html 


More information about the Pyrex mailing list