[Numpy-svn] r4569 - in trunk/numpy/distutils: . command
numpy-svn at scipy.org
numpy-svn at scipy.org
Wed Dec 12 15:12:12 EST 2007
Author: rkern
Date: 2007-12-12 14:12:10 -0600 (Wed, 12 Dec 2007)
New Revision: 4569
Added:
trunk/numpy/distutils/command/develop.py
Modified:
trunk/numpy/distutils/command/egg_info.py
trunk/numpy/distutils/core.py
Log:
Make the 'develop' command from setuptools run build_src --inplace in addition to build_ext --inplace. This allows SWIG wrappers to be correctly generated.
Added: trunk/numpy/distutils/command/develop.py
===================================================================
--- trunk/numpy/distutils/command/develop.py 2007-12-12 06:15:15 UTC (rev 4568)
+++ trunk/numpy/distutils/command/develop.py 2007-12-12 20:12:10 UTC (rev 4569)
@@ -0,0 +1,12 @@
+""" Override the develop command from setuptools so we can ensure that build_src
+--inplace gets executed.
+"""
+
+from setuptools.command.develop import develop as old_develop
+
+class develop(old_develop):
+ __doc__ = old_develop.__doc__
+ def install_for_development(self):
+ # Build sources in-place, too.
+ self.reinitialize_command('build_src', inplace=1)
+ old_develop.install_for_development(self)
Property changes on: trunk/numpy/distutils/command/develop.py
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/numpy/distutils/command/egg_info.py
===================================================================
--- trunk/numpy/distutils/command/egg_info.py 2007-12-12 06:15:15 UTC (rev 4568)
+++ trunk/numpy/distutils/command/egg_info.py 2007-12-12 20:12:10 UTC (rev 4569)
@@ -2,5 +2,8 @@
class egg_info(_egg_info):
def run(self):
+ # We need to ensure that build_src has been executed in order to give
+ # setuptools' egg_info command real filenames instead of functions which
+ # generate files.
self.run_command("build_src")
_egg_info.run(self)
Modified: trunk/numpy/distutils/core.py
===================================================================
--- trunk/numpy/distutils/core.py 2007-12-12 06:15:15 UTC (rev 4568)
+++ trunk/numpy/distutils/core.py 2007-12-12 20:12:10 UTC (rev 4569)
@@ -6,7 +6,7 @@
have_setuptools = True
from setuptools import setup as old_setup
# easy_install imports math, it may be picked up from cwd
- from setuptools.command import develop, easy_install
+ from setuptools.command import easy_install
try:
# very old versions of setuptools don't have this
from setuptools.command import bdist_egg
@@ -42,7 +42,9 @@
'bdist_rpm': bdist_rpm.bdist_rpm,
}
if have_setuptools:
- from numpy.distutils.command import egg_info
+ # Use our own versions of develop and egg_info to ensure that build_src is
+ # handled appropriately.
+ from numpy.distutils.command import develop, egg_info
numpy_cmdclass['bdist_egg'] = bdist_egg.bdist_egg
numpy_cmdclass['develop'] = develop.develop
numpy_cmdclass['easy_install'] = easy_install.easy_install
More information about the Numpy-svn
mailing list