[Numpy-discussion] py3k execfile('setup.py')

Ralf Gommers ralf.gommers@googlemail....
Sat Aug 14 08:11:54 CDT 2010


On Fri, Jul 30, 2010 at 12:04 AM, Pauli Virtanen <pav@iki.fi> wrote:

> Thu, 29 Jul 2010 23:39:19 +0800, Ralf Gommers wrote:
> > The execfile builtin has disappeared in python 3.x, so I'm trying to
> > find another solution for the use of it in setupegg.py. So far I've
> > tried
>
> I'd do something like this in "setup.py":
>
>  ...
>
> + if os.environ.get('USE_SETUPTOOLS'):
> +     import setuptools
>  from numpy.distutils.core import setup
>  ...
>
> And then 'setupegg.py' is trivial to write.
>
> But no idea why it hangs, though. You could maybe also try 'import setup'
>

Actually, it was hanging because of bdist_mpkg which I was using. Now your
suggestion above and using imp both can give me an egg install. "import
setup" doesn't work, numpy.distutils gets unhappy somewhere.

Installing into a local virtualenv (with either of the methods that work)
looks good. Into /Library/Frameworks/..., nose refuses to run any tests, due
to the files being executable. But I think that's normal. Changing
permissions to 644 manually it all looks good again.

I prefer to use imp because it doesn't change setup.py. Adding
USE_SETUPTOOLS to setup.py could give the impression that it may actually be
a good idea to use this, which it's not. Proposed fix:
http://github.com/rgommers/numpy/tree/setupegg

What's left is to create an OS X installer. bdist_mpkg is not maintained
anymore, so I'm not sure what the best option is. Any suggestions?

Cheers,
Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100814/67a60ebe/attachment.html 


More information about the NumPy-Discussion mailing list