Skip to content

chore: update default Python version to 3.14 - #4023

Merged
rickeylev merged 5 commits into
bazel-contrib:mainfrom
rickeylev:update_default_python_314
Sep 2, 2026
Merged

rickeylev merged 5 commits into
bazel-contrib:mainfrom
rickeylev:update_default_python_314

Conversation

@rickeylev

@rickeylev rickeylev commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

Update the default Python toolchain version from 3.11 to 3.14 to align
with newer Python releases and provide modern defaults out of the box.

This updates the default toolchain version configurations in the module
extension, documentation, and test suites.

@rickeylev rickeylev changed the title feat: update default Python version to 3.14 chore: update default Python version to 3.14 Aug 9, 2026

@rickeylev rickeylev left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aignas Can you double check the logic in python/private/pypi/whl_extract.bzl?

It said that the RECORD file had invalid paths: the original paths in the wheel were present, but its actually supposed to reflect the install path. In this case, we have e.g. https://github.com/bazel-contrib/rules_python/blob/main/tests/repos/whl_with_data1

Up above, L40-50 is where the remap of schemes occurs.

From what I can tell, I think its right. Starting in Python 3.14 it seems that metadata.files() is stricter.

That said, I'm not entirely confident in the rewritten values it gives. e.g. ../data/ ? I guess it's up-referencing up out of the site-packages dir and into the venv? I suppose that's correct.

@rickeylev

Copy link
Copy Markdown
Collaborator Author

I created #4025 to show as a repro for this metadata.files bug. I think this is pre-existing? It might just be that 3.14 got more strict about things.

@aignas

aignas commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

@aignas Can you double check the logic in python/private/pypi/whl_extract.bzl?

Hmm, if it is install path, then indeed the RECORD files will be incorrect and it seems that we need to rewrite them and we are not. We are just leaving whatever was in the wheel to begin with.

@aignas

aignas commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Looks like this is very close - only requirements locking tests are remaining.

rickeylev added a commit to rickeylev/rules_python that referenced this pull request Aug 23, 2026
…ility and fix match() (bazel-contrib#4100)

Align runfiles.Path method signatures with Python 3.14 typeshed stubs to
avoid type checker errors on newer Python releases. This also fixes a
bug where pattern matching failed on Python 3.12+.

This change splits the runfiles compatibility updates from PR bazel-contrib#4023.
Update default Python toolchain version from 3.11 to 3.14 across
MODULE.bazel, WORKSPACE, documentation, and tests. Also add
legacy-cgi to wheel example requirements for Python >=3.13 and
handle Windows CRLF line checkout impact in wheel sha256 tests.
@rickeylev
rickeylev force-pushed the update_default_python_314 branch from adfdb61 to 8bbc94c Compare August 28, 2026 01:36
@rickeylev
rickeylev marked this pull request as ready for review August 29, 2026 22:55
@rickeylev
rickeylev requested a review from aignas as a code owner August 29, 2026 22:55
@rickeylev

Copy link
Copy Markdown
Collaborator Author

PTAL. Finally ready; this is pretty much just 3.XX -> 3.YY now.

@rickeylev
rickeylev enabled auto-merge September 2, 2026 07:08
@rickeylev
rickeylev disabled auto-merge September 2, 2026 07:08
…ples

Update interpreter test versions tuple to include 3.13 and 3.14 to
exercise the new default Python version. Update workspace registration
examples, twine fixed runtime description, and repl console output in
documentation, as well as the release notes template.
@rickeylev
rickeylev enabled auto-merge September 2, 2026 07:42
@rickeylev
rickeylev added this pull request to the merge queue Sep 2, 2026
Merged via the queue into bazel-contrib:main with commit c90ceb9 Sep 2, 2026
5 checks passed
@rickeylev
rickeylev deleted the update_default_python_314 branch September 2, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants