From 07fe22d6c0c68f524c0a12a717df388913f14d1b Mon Sep 17 00:00:00 2001 From: Kevin Bernal Date: Mon, 3 Feb 2025 09:45:18 +1100 Subject: [PATCH] fix(coverage): prevent issues when packages execute files in tmp dir. Fixes https://github.com/bazelbuild/rules_python/issues/2575 --- CHANGELOG.md | 2 ++ python/private/python_bootstrap_template.txt | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82aeda8117..3f9972fa12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,8 @@ Unreleased changes template. The related issue is [#908](https://github.com/bazelbuild/rules_python/issue/908). * (sphinxdocs) Do not crash when `tag_class` does not have a populated `doc` value. Fixes ([#2579](https://github.com/bazelbuild/rules_python/issues/2579)). +* (coverage) Prevent coveragepy report issues when packages execute files in tmp dir. + Fixes ([#2575](https://github.com/bazelbuild/rules_python/issues/2575)). {#v0-0-0-added} ### Added diff --git a/python/private/python_bootstrap_template.txt b/python/private/python_bootstrap_template.txt index e3b39e30cd..2b7288f79e 100644 --- a/python/private/python_bootstrap_template.txt +++ b/python/private/python_bootstrap_template.txt @@ -461,6 +461,9 @@ relative_files = True kparams['stdout'] = sys.stderr kparams['stderr'] = sys.stderr + # Prevent coveragepy report issues when packages execute files in tmp dir. + params.append('--omit="$TMPDIR/*"') + ret_code = subprocess.call( params, **kparams