aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/extension.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-08-06 18:46:28 +0000
committerPJ Eby <distutils-sig@python.org>2005-08-06 18:46:28 +0000
commit8a29467d941a7983d5f6eadc5c0e1624417944b6 (patch)
treeb270afe3a01c9bead94060de3c3adfa590bd933f /setuptools/extension.py
parenta762d97ea517f64a405d82ad7acaa85d3eb30c39 (diff)
downloadexternal_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.tar.gz
external_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.tar.bz2
external_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.zip
Enhanced setuptools infrastructure to support distutils extensions that
can be plugged in at setup() time to define new setup() arguments or distutils commands. This allows modularization and reuse of distutils extensions in a way that was previously not possible. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041180
Diffstat (limited to 'setuptools/extension.py')
-rw-r--r--setuptools/extension.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/extension.py b/setuptools/extension.py
index 55a4d946..37b62576 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -7,6 +7,9 @@ except ImportError:
# Pyrex isn't around, so fix up the sources
+ from dist import _get_unpatched
+ _Extension = _get_unpatched(_Extension)
+
class Extension(_Extension):
"""Extension that uses '.c' files in place of '.pyx' files"""
@@ -21,7 +24,14 @@ except ImportError:
sources.append(s)
self.sources = sources
+ import sys, distutils.core, distutils.extension
+ distutils.core.Extension = Extension
+ distutils.extension.Extension = Extension
+ if 'distutils.command.build_ext' in sys.modules:
+ sys.modules['distutils.command.build_ext'].Extension = Extension
+
else:
# Pyrex is here, just use regular extension type
Extension = _Extension
+