Skip to content

Conversation

@kotlaja
Copy link
Collaborator

@kotlaja kotlaja commented Oct 20, 2025

  • Fix regex so module name is the same as the workspace name
  • Add note to users to add python.toolchain() call for each version in python_register_multi_toolchains. This is hard to select from the migration tool itself due to being visible only for "python_3_x_toolchains" targets in resolved_deps (these targets are not used directly in most of the cases).

@kotlaja kotlaja requested a review from a team as a code owner October 20, 2025 16:18
@kotlaja kotlaja added the migration-tool-testing Test if this change affects migration tool. label Oct 20, 2025
@kotlaja kotlaja requested a review from meteorcloudy October 20, 2025 16:18
Copy link
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 introduces a couple of useful improvements to the Bzlmod migration tool. The regex for parsing the workspace name is now more robust, and an important note has been added for users of python_register_multi_toolchains. I've suggested a small improvement to the formatting of the new message to ensure it's displayed correctly to the user. The removal of the add_python_repo function is also noted, presumably as dead code removal.

@meteorcloudy meteorcloudy changed the title Simple upgrades to Bzlmod migration toon Simple upgrades to Bzlmod migration tool Oct 21, 2025
meteorcloudy
meteorcloudy previously approved these changes Oct 21, 2025
@bazel-io bazel-io dismissed meteorcloudy’s stale review October 21, 2025 13:46

Require module maintainers' approval for newly pushed changes.

@kotlaja
Copy link
Collaborator Author

kotlaja commented Oct 21, 2025

Fixed it with minor changes so it's more readable to users. With the current change invoking migration tool in the python extension test env looks:

bazel 7.6.1

Detected original workspace name: py_extension

Generating ./resolved_deps.py file - It might take a while...

RESOLVED: `rules_python` has been introduced as a Bazel module.
IMPORTANT: 3.11 is used as a default python version.
                If you need a different version, please change it manually and then rerun the migration tool.
                If you're using `python_register_multi_toolchains`, add `python.toolchain` for each python version.
RESOLVED: `my_deps_2` has been introduced as python extension, with python_version=3.11.
RESOLVED: `my_deps_1` has been introduced as python extension, with python_version=3.11.

Congratulations! All external repositories needed for building `//...` are available with Bzlmod!
IMPORTANT: Fix potential build time issues by running the following command:
        `bazel build --enable_bzlmod --noenable_workspace //...`

IMPORTANT: For details about the migration process, check `migration_info.md` file.

Before this change it was one more IMPORTANT note which was confusing since every next (2+) dep would print:

IMPORTANT: Using existing default python version {python_version} from MODULE.bazel.

which is unsuitable next to the previous IMPORTANT note regarding python version.

meteorcloudy
meteorcloudy previously approved these changes Oct 21, 2025
@meteorcloudy
Copy link
Member

Please address the format issue.

@bazel-io bazel-io dismissed meteorcloudy’s stale review October 21, 2025 14:02

Require module maintainers' approval for newly pushed changes.

@kotlaja
Copy link
Collaborator Author

kotlaja commented Oct 21, 2025

@meteorcloudy PTAL :)

@meteorcloudy meteorcloudy merged commit cc66082 into bazelbuild:main Oct 22, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

migration-tool-testing Test if this change affects migration tool.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants