summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/build_ext.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 (GMT)
commitcd8a1148e19116db109f27d26c02e1de536dc76e (patch)
treee3969bc16f8ef0c540f1d0e72fb0da711344d758 /Lib/distutils/command/build_ext.py
parent6fa82a34775576b90c8ec38e8968dfbb0b02e11d (diff)
downloadcpython-cd8a1148e19116db109f27d26c02e1de536dc76e.zip
cpython-cd8a1148e19116db109f27d26c02e1de536dc76e.tar.gz
cpython-cd8a1148e19116db109f27d26c02e1de536dc76e.tar.bz2
Make setup.py less chatty by default.
This is a conservative version of SF patch 504889. It uses the log module instead of calling print in various places, and it ignores the verbose argument passed to many functions and set as an attribute on some objects. Instead, it uses the verbosity set on the logger via the command line. The log module is now preferred over announce() and warn() methods that exist only for backwards compatibility. XXX This checkin changes a lot of modules that have no test suite and aren't exercised by the Python build process. It will need substantial testing.
Diffstat (limited to 'Lib/distutils/command/build_ext.py')
-rw-r--r--Lib/distutils/command/build_ext.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index ddbd03e..89ca1dc 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -15,6 +15,7 @@ from distutils.errors import *
from distutils.sysconfig import customize_compiler
from distutils.dep_util import newer_group
from distutils.extension import Extension
+from distutils import log
# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
@@ -291,9 +292,9 @@ class build_ext (Command):
# by Extension constructor)
(ext_name, build_info) = ext
- self.warn(("old-style (ext_name, build_info) tuple found in "
- "ext_modules for extension '%s'"
- "-- please convert to Extension instance" % ext_name))
+ log.warn(("old-style (ext_name, build_info) tuple found in "
+ "ext_modules for extension '%s'"
+ "-- please convert to Extension instance" % ext_name))
if type(ext) is not TupleType and len(ext) != 2:
raise DistutilsSetupError, \
("each element of 'ext_modules' option must be an "
@@ -329,8 +330,8 @@ class build_ext (Command):
# Medium-easy stuff: same syntax/semantics, different names.
ext.runtime_library_dirs = build_info.get('rpath')
if build_info.has_key('def_file'):
- self.warn("'def_file' element of build info dict "
- "no longer supported")
+ log.warn("'def_file' element of build info dict "
+ "no longer supported")
# Non-trivial stuff: 'macros' split into 'define_macros'
# and 'undef_macros'.
@@ -422,11 +423,10 @@ class build_ext (Command):
self.get_ext_filename(fullname))
if not (self.force or newer_group(sources, ext_filename, 'newer')):
- self.announce("skipping '%s' extension (up-to-date)" %
- ext.name)
+ log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
- self.announce("building '%s' extension" % ext.name)
+ log.info("building '%s' extension", ext.name)
# First, scan the sources for SWIG definition files (.i), run
# SWIG on 'em to create .c files, and modify the sources list
@@ -539,7 +539,7 @@ class build_ext (Command):
for source in swig_sources:
target = swig_targets[source]
- self.announce("swigging %s to %s" % (source, target))
+ log.info("swigging %s to %s", source, target)
self.spawn(swig_cmd + ["-o", target, source])
return new_sources