Hi, 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 if sys.version_info[0] >= 3: # 3.x doesn't have execfile anymore, so we define our own # The code below is syntactically valid 2.x, but 2.x thinks that a tuple # gets passed to the exec statement. (from Twisted) def execfile(filename, globals=None, locals=None): exec(compile(open(filename).read(), filename, 'exec'), globals, locals) and: if sys.version_info[0] >= 3: import imp setupfile = imp.load_source('setupfile', 'setup.py') setupfile.setup_package() Both of the above attempts hang at: $ paver dmg -p 3.1 ---> pavement.dmg ---> pavement.clean LDFLAGS='-undefined dynamic_lookup -bundle -arch i386 -arch ppc -Wl,-search_paths_first -Lbuild' /Library/Frameworks/Python.framework/Versions/3.1/bin/python3 setupegg.py bdist_mpkg Converting to Python3 via 2to3... Looks like the combination of setuptools, numpy.distutils and 2to3 is too much for me to wrap my head around. Anyone have an idea? Cheers, Ralf
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' Pauli
On Fri, Jul 30, 2010 at 12:04 AM, Pauli Virtanen
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
On Sat, Aug 14, 2010 at 6:11 AM, Ralf Gommers
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.
You can also pass --exe to nose to override this safety, if you want (output of nosetests --help below): --exe Look for tests in python modules that are executable. Normal behavior is to exclude executable modules, since they may not be import-safe [NOSE_INCLUDE_EXE] --noexe DO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.) Cheers, f ps - congrats to all of you for the progress on the py3k work!
On Tue, Aug 17, 2010 at 2:07 PM, Fernando Perez
On Sat, Aug 14, 2010 at 6:11 AM, Ralf Gommers
wrote: 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.
You can also pass --exe to nose to override this safety, if you want (output of nosetests --help below):
--exe Look for tests in python modules that are executable. Normal behavior is to exclude executable modules, since they may not be import-safe [NOSE_INCLUDE_EXE] --noexe DO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.)
Thanks, that does the trick. Tests run with "np.test(extra_argv=['--exe'])". I didn't notice at first that setuptools always does this, also for python 2.x installs through setupegg.py.
Committed in r8655. Cheers, Ralf
participants (3)
-
Fernando Perez
-
Pauli Virtanen
-
Ralf Gommers