Skip to content

chore: upgrade bzlmod example python versions#3728

Closed
aignas wants to merge 3 commits intobazel-contrib:mainfrom
aignas:aignas.chore.bump-example-python-version
Closed

chore: upgrade bzlmod example python versions#3728
aignas wants to merge 3 commits intobazel-contrib:mainfrom
aignas:aignas.chore.bump-example-python-version

Conversation

@aignas
Copy link
Copy Markdown
Collaborator

@aignas aignas commented Apr 23, 2026

This is preparatory work for #2704.

@aignas aignas requested a review from rickeylev as a code owner April 23, 2026 14:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the Python versions in the bzlmod example to 3.11, 3.12, and 3.13, updating toolchains, dependencies, and test targets. The review feedback highlights several inconsistencies in the lockfiles, such as headers referencing incorrect Python versions or tools, and suggests regenerating them to ensure compatibility with the new target versions. A typo in a repository name within a comment was also identified for correction.

Comment thread examples/bzlmod/MODULE.bazel Outdated
requirements_by_platform = {
# Default requirements file for needs to explicitly provide the platforms
"//:requirements_lock_3_11.txt": "linux_*,osx_*",
"//:requirements_lock_3_13.txt": "linux_*,osx_*",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The lockfile requirements_lock_3_13.txt appears to be a rename of the old requirements_lock_3_9.txt. Using lockfile content generated for Python 3.9 with Python 3.13 is likely incorrect and will lead to compatibility issues. All lockfiles should be regenerated for their respective new Python versions.

Comment on lines +2 to +5
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# bazel run //:requirements_3_10.update
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The header in this lockfile is inconsistent with the target version and the tools used in this example. It references Python 3.10 and pip-compile, while the file is intended for Python 3.11 and the example uses uv (as seen in MODULE.bazel). Furthermore, several packages appear to have been downgraded (e.g., alabaster from 0.7.16 to 0.7.13), which is unexpected for an upgrade PR. This lockfile should be regenerated using the correct tools and Python version.

Comment on lines +2 to +5
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# bazel run //:requirements_3_10.update
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This Windows-specific lockfile has an incorrect header referencing Python 3.10. Additionally, this file is no longer referenced in examples/bzlmod/MODULE.bazel and appears to be unused. It should either be removed or correctly integrated into the pip.parse configuration for Python 3.11.

Comment on lines +1 to +2
# This file was autogenerated by uv via the following command:
# bazel run //examples:bzlmod_requirements_3_11_windows.update
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The header in this new lockfile references bzlmod_requirements_3_11_windows.update, which is inconsistent with the file's version (3.13).

Comment thread examples/bzlmod/BUILD.bazel Outdated
# ruleset. When the symbol is loaded you can use the rule.

# The names @pip and @python_39 are values that are repository
# The names @pip and @python_311 are values that are repository
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There is a typo in the repository name mentioned in this comment. It should be @python_3_11 to match the repository names defined in MODULE.bazel.

Suggested change
# The names @pip and @python_311 are values that are repository
# The names @pip and @python_3_11 are values that are repository

@aignas aignas force-pushed the aignas.chore.bump-example-python-version branch from 3931c13 to c613770 Compare April 23, 2026 14:55
@aignas aignas closed this Apr 23, 2026
@aignas aignas deleted the aignas.chore.bump-example-python-version branch April 23, 2026 14:57
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.

1 participant