Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions python/private/stage2_bootstrap_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,29 +323,28 @@ def _maybe_collect_coverage(enable):
relative_files = True
source =
\t{source}
omit =
# Pipes can't be read back later, which can cause coverage to
# throw an error when trying to get its source code.
/dev/fd/*
# The mechanism for finding third-party packages in coverage-py
# only works for installed packages, not for runfiles. e.g:
#'$HOME/.local/lib/python3.10/site-packages',
# '/usr/lib/python',
# '/usr/lib/python3.10/site-packages',
# '/usr/local/lib/python3.10/dist-packages'
# see https://github.com/nedbat/coveragepy/blob/bfb0c708fdd8182b2a9f0fc403596693ef65e475/coverage/inorout.py#L153-L164
*/external/*
"""
)
try:
cov = coverage.Coverage(
config_file=rcfile_name,
config_file=os.environ.get("COVERAGE_RCFILE", rcfile_name),
branch=True,
# NOTE: The messages arg controls what coverage prints to stdout/stderr,
# which can interfere with the Bazel coverage command. Enabling message
# output is only useful for debugging coverage support.
messages=is_verbose_coverage(),
omit=[
# Pipes can't be read back later, which can cause coverage to
# throw an error when trying to get its source code.
"/dev/fd/*",
# The mechanism for finding third-party packages in coverage-py
# only works for installed packages, not for runfiles. e.g:
#'$HOME/.local/lib/python3.10/site-packages',
# '/usr/lib/python',
# '/usr/lib/python3.10/site-packages',
# '/usr/local/lib/python3.10/dist-packages'
# see https://github.com/nedbat/coveragepy/blob/bfb0c708fdd8182b2a9f0fc403596693ef65e475/coverage/inorout.py#L153-L164
"*/external/*",
],
)
cov.start()
try:
Expand Down