File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ A brief description of the categories of changes:
27
27
### Changed
28
28
* Nothing yet
29
29
30
+ ### Fixed
31
+ * (rule) Omit third-party python packages from coverage reports
32
+ ([ #2136 ] ( https://github.com/bazelbuild/rules_python/issues/2136 ) )
33
+
30
34
### Added
31
35
* Nothing yet
32
36
Original file line number Diff line number Diff line change @@ -364,6 +364,14 @@ def _maybe_collect_coverage(enable):
364
364
# Pipes can't be read back later, which can cause coverage to
365
365
# throw an error when trying to get its source code.
366
366
"/dev/fd/*" ,
367
+ # The mechanism for finding third-party packages in coverage-py
368
+ # only works for installed packages, not for runfiles. e.g:
369
+ #'$HOME/.local/lib/python3.10/site-packages',
370
+ # '/usr/lib/python',
371
+ # '/usr/lib/python3.10/site-packages',
372
+ # '/usr/local/lib/python3.10/dist-packages'
373
+ # see https://github.com/nedbat/coveragepy/blob/bfb0c708fdd8182b2a9f0fc403596693ef65e475/coverage/inorout.py#L153-L164
374
+ "*/external/*" ,
367
375
],
368
376
)
369
377
cov .start ()
You can’t perform that action at this time.
0 commit comments