diff options
author | PJ Eby <distutils-sig@python.org> | 2004-03-19 20:53:14 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2004-03-19 20:53:14 +0000 |
commit | 8423e1ed14ac1691c2863c6e8cac9230cf558d7b (patch) | |
tree | 79f2d2cef146e08a9480357637cca4662307bd08 /setuptools/extension.py | |
download | external_python_setuptools-8423e1ed14ac1691c2863c6e8cac9230cf558d7b.tar.gz external_python_setuptools-8423e1ed14ac1691c2863c6e8cac9230cf558d7b.tar.bz2 external_python_setuptools-8423e1ed14ac1691c2863c6e8cac9230cf558d7b.zip |
Initial checkin of setuptools 0.0.1.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4040869
Diffstat (limited to 'setuptools/extension.py')
-rw-r--r-- | setuptools/extension.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/setuptools/extension.py b/setuptools/extension.py new file mode 100644 index 00000000..55a4d946 --- /dev/null +++ b/setuptools/extension.py @@ -0,0 +1,27 @@ +from distutils.core import Extension as _Extension + +try: + from Pyrex.Distutils.build_ext import build_ext + +except ImportError: + + # Pyrex isn't around, so fix up the sources + + class Extension(_Extension): + + """Extension that uses '.c' files in place of '.pyx' files""" + + def __init__(self,*args,**kw): + _Extension.__init__(self,*args,**kw) + sources = [] + for s in self.sources: + if s.endswith('.pyx'): + sources.append(s[:-3]+'c') + else: + sources.append(s) + self.sources = sources + +else: + + # Pyrex is here, just use regular extension type + Extension = _Extension |