feat(coverage): add Python 3.14 support and bump coverage.py to 7.10.7#3764
Merged
Conversation
- Regenerate coverage_deps.bzl against coverage 7.10.7 - Add cp314 (incl. freethreaded cp314t variants) to the bundled set - Drop cp38 (coverage.py 7.6.2 dropped Python 3.8) - Teach update_coverage_deps.py the newer wheel platform tags (manylinux1_x86_64, macosx_10_13_x86_64) used by coverage 7.10.7 - Narrow coverage.patch context to apply against the 7.10.7 coverage/__main__.py layout
- coverage.md: note that configure_coverage_tool=True is only effective for the Python versions the bundled coverage wheel set covers (CPython 3.9-3.14, freethreaded for 3.13+); outside that range it is a silent no-op and produces empty lcov. - devguide.md: bump the example version in the regen command from 7.6.1 to 7.10.7 to match what is now bundled.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates coverage.py to 7.10.7, adds support for Python 3.14 (including freethreaded variants), and drops support for Python 3.8. The changes span dependency definitions, documentation, and the dependency update tool. Feedback was provided regarding the placement of the CHANGELOG entry, suggesting it be moved to a more appropriate section.
aignas
approved these changes
May 10, 2026
| :::{note} | ||
| The bundled `coverage` wheel set covers CPython 3.9 through 3.14 (with | ||
| freethreaded variants for 3.13+). For Python versions outside that range, | ||
| `configure_coverage_tool = True` is a silent no-op and `bazel coverage` will |
Collaborator
There was a problem hiding this comment.
I would be happy to receive a PR for bzlmod that would print a warning if the coverage tool was not found.
Contributor
Author
This was referenced May 10, 2026
pull Bot
pushed a commit
to garymm/rules_python
that referenced
this pull request
May 20, 2026
…ested python_version/platform (bazel-contrib#3766) Addresses review feedback on bazel-contrib#3764: ~~NOTE: Starlark unit tests have no way to capture stdout/stderr, so we can't directly assert that the warning is printed. I am not sure if the refactoring-for-testability I have considered would be appreciated, so this PR is a minimal approach. (I will also prepare an alternative PR that includes a small refactor and some tests, in case that is preferred.)~~ A logger has been added, and is used in testing. Previously, when `configure_coverage_tool = True` was set but the bundled `coverage.py` wheel set had no entry for the requested (python_version, platform), `coverage_dep` returned None silently. The result was that `bazel coverage` produced empty per-test lcov files for `py_test` targets with no signal to the user that coverage was unconfigured. Print a WARNING in that path so the misconfiguration is visible. Preserves the existing silent return for the windows branch, which is intentionally quiet because the upstream coverage wrapper does not support windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On rules_python 2.0.0,
python.toolchain(configure_coverage_tool = True)is a silent no-op whenpython_version = "3.14": the bundledcoverage.pywheel set inpython/private/coverage_deps.bzlcovers cp310–cp313 only, sobazel coverageproduces zero-byte per-test lcov files forpy_testtargets. This PR bumps the bundled coverage to 7.10.7 (which ships cp39–cp314 wheels, including freethreaded variants for cp313+) and regenerates the wheel set.coverage_deps.bzlagainst coverage 7.10.7update_coverage_deps.py's_supported_platformsmap with the newer wheel platform tags (manylinux1_x86_64,macosx_10_13_x86_64) used by coverage 7.10.7coverage.patchcontext to apply against the 7.10.7coverage/__main__.pylayoutdocs/coverage.mdVerification:
bazel test //tests/python:python_tests //tests/py_runtime:py_runtime_tests --test_tag_filters=-integration-test→ 37/37 pass (incl.test_coverage_tool_executable,test_coverage_tool_plain_files)local_path_overridethis branch into a minimal external workspace, setpython_version = "3.14"withconfigure_coverage_tool = True, runbazel coverageon apy_test→ produces a non-empty per-test lcov withSF:,FNDA:reflecting actual call counts, andLH:non-zero