Skip to content

Commit

Permalink
Better control over setup.py warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 10, 2021
1 parent 4748470 commit 5a76fa9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@
from distutils.core import Extension # pylint: disable=wrong-import-order
from distutils.command.build_ext import build_ext # pylint: disable=wrong-import-order
from distutils import errors # pylint: disable=wrong-import-order

import distutils.log # pylint: disable=wrong-import-order

# $set_env.py: COVERAGE_QUIETER - Set to remove some noise from test output.
if bool(int(os.getenv("COVERAGE_QUIETER", "0"))):
# Distutils has its own mini-logging code, and it sets the level too high.
# When I ask for --quiet when running tessts, I don't want to see warnings.
old_set_verbosity = distutils.log.set_verbosity
def better_set_verbosity(v):
"""--quiet means no warnings!"""
if v <= 0:
distutils.log.set_threshold(distutils.log.ERROR)
else:
old_set_verbosity(v)
distutils.log.set_verbosity = better_set_verbosity

# Get or massage our metadata. We exec coverage/version.py so we can avoid
# importing the product code into setup.py.
Expand Down

0 comments on commit 5a76fa9

Please sign in to comment.