summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/build_ext.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-01-30 18:34:15 (GMT)
committerGreg Ward <gward@python.net>2000-01-30 18:34:15 (GMT)
commit37bc81505379facad85a7c6ff273de0201f28656 (patch)
treef2c2208609ff73860b86da445fbb7669847b5bbc /Lib/distutils/command/build_ext.py
parent4c67936e4eab6db332c32b51f45c91870fb58d90 (diff)
downloadcpython-37bc81505379facad85a7c6ff273de0201f28656.zip
cpython-37bc81505379facad85a7c6ff273de0201f28656.tar.gz
cpython-37bc81505379facad85a7c6ff273de0201f28656.tar.bz2
Added 'description' class attribute to every command class (to help the
'--help-commands' option). Shuffled imports around in a few command modules to avoid expensive up-front import of sysconfig (and resulting delays in generating list of all commands).
Diffstat (limited to 'Lib/distutils/command/build_ext.py')
-rw-r--r--Lib/distutils/command/build_ext.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index d38cb18..4f7e53f 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -11,8 +11,6 @@ __rcsid__ = "$Id$"
import sys, os, string, re
from types import *
from distutils.core import Command
-from distutils.ccompiler import new_compiler
-from distutils.sysconfig import INCLUDEPY, SO, exec_prefix
from distutils.errors import *
@@ -24,6 +22,8 @@ extension_name_re = re.compile \
class BuildExt (Command):
+ description = "build C/C++ extensions (compile/link to build directory)"
+
# XXX thoughts on how to deal with complex command-line options like
# these, i.e. how to make it so fancy_getopt can suck them off the
# command line and make it look like setup.py defined the appropriate
@@ -76,6 +76,8 @@ class BuildExt (Command):
def set_final_options (self):
+ from distutils import sysconfig
+
self.set_undefined_options ('build', ('build_platlib', 'build_dir'))
if self.package is None:
@@ -88,8 +90,8 @@ class BuildExt (Command):
# etc.) are in the include search path. We have to roll our own
# "exec include dir", because the Makefile parsed by sysconfig
# doesn't have it (sigh).
- py_include = INCLUDEPY # prefix + "include" + "python" + ver
- exec_py_include = os.path.join (exec_prefix, 'include',
+ py_include = sysconfig.INCLUDEPY # prefix + "include" + "python" + ver
+ exec_py_include = os.path.join (sysconfig.exec_prefix, 'include',
'python' + sys.version[0:3])
if self.include_dirs is None:
self.include_dirs = self.distribution.include_dirs or []
@@ -104,6 +106,8 @@ class BuildExt (Command):
def run (self):
+ from distutils.ccompiler import new_compiler
+
# 'self.extensions', as supplied by setup.py, is a list of 2-tuples.
# Each tuple is simple:
# (ext_name, build_info)
@@ -246,9 +250,10 @@ class BuildExt (Command):
def extension_filename (self, ext_name, package=None):
+ from distutils import sysconfig
if package:
ext_name = package + '.' + ext_name
ext_path = string.split (ext_name, '.')
- return apply (os.path.join, ext_path) + SO
+ return apply (os.path.join, ext_path) + sysconfig.SO
# class BuildExt