aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-11-26 17:31:14 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-11-26 23:24:22 +0000
commit2ef8c00cae0be47fcacf631a68a8298bd89213e3 (patch)
tree40480085402b8ada1893113ee1716d902f07bbb3
parentff7850ec3096a0090d4bd4bfe25e2cf7f0bccd05 (diff)
setup.py: Fix no log messages being shown during setup call
The default verbosity of a log object is WARN. distutils then set it to INFO when initializing the Distribution object. This would not affect the log object copy that setuptools exposes (and we now use). This caused the usual INFO messages not to be shown anymore. Explicitly set the setuptools log object verbosity to INFO unless the quiet option was given. Amends 95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028 Change-Id: I793dc92582007895fa23d43baabe5b97c146552e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 4b78450bae8bf839d6d438bc4f92efdcdc3979a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--build_scripts/setup_runner.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/build_scripts/setup_runner.py b/build_scripts/setup_runner.py
index ddf98fef0..5e0b2b486 100644
--- a/build_scripts/setup_runner.py
+++ b/build_scripts/setup_runner.py
@@ -116,6 +116,18 @@ class SetupRunner(object):
setup_script_dir=self.setup_script_dir,
quiet=OPTION["QUIET"])
+ # Enable logging for both the top-level invocation of setup.py
+ # as well as for child invocations. We we now use
+ # setuptools._distutils.log instead of distutils.log, and this
+ # new log object does not have its verbosity set by default
+ # when setuptools instantiates a distutils Distribution object,
+ # which calls
+ # dist.parse_command_line() -> log.set_verbosity(self.verbose)
+ # on the old distutils log object.
+ # So we do it explicitly here.
+ if not OPTION["QUIET"]:
+ log.set_verbosity(log.INFO)
+
# This is an internal invocation of setup.py, so start actual
# build.
if config.is_internal_invocation():
@@ -125,10 +137,6 @@ class SetupRunner(object):
self.run_setuptools_setup()
return
- # Enable logging.
- if not OPTION["QUIET"]:
- log.set_verbosity(log.INFO)
-
# This is a top-level invocation of setup.py, so figure out what
# modules we will build and depending on that, call setup.py
# multiple times with different arguments.