mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
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.
This commit is contained in:
parent
6fa82a3477
commit
cd8a1148e1
32 changed files with 260 additions and 313 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue