8000 Support gazelle plugin when using bzlmod · Issue #965 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content
Support gazelle plugin when using bzlmod #965
Closed
@aignas

Description

@aignas

🚀 feature request

Creating this issue to encompass all of the PRs related to this feature, as the single research PR (#961) got a little bit too big for easy review.

Relevant Rules

gazelle Python plugin.

Description

Currently the gazelle plugin does not work if using bzlmod with bazel >= 6.0.0. This is due to:

  • Gazelle and go toolchain is not present in MODULE.bazel of rules_python, which means that the plugin reference fails.
  • The all_whl_requirements have labels, that do not work in bzlmod due to repository remapping. Hence, the modules_mapping rule fails unless we do something about it.
  • Gazelle will generate dependency labels in the targets that do not work in bzlmod due to repository remapping.

Describe the solution you'd like

As researched in #961, we can fix these three issues separately:

  1. Adding gazelle and go as bzlmod deps.
  2. Changing the contents of the all_whl_requirements and all_requirements based on wether bzlmod is used.
  3. Have extra declaratives for changing the generated labels to work with bzlmod.
  4. Have extra aliases in the @pip repo that work with both, bzlmod and classic gazelle. This might be similar to feat: add alias generation for pip parse #814, however this is not a requirement to make gazelle with bzlmod work.

Describe alternatives you've considered

Rejected alternatives:

  • Having a flag in gazelle_python.yaml manifest, which would say that we are using bzlmod. The manifest should be the same irrespective of whether we are using bzlmod or not due to the same reason why we may want to have aliases in @pip repo -- because we want to enable a smooth transition to bzlmod as described in the migration guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0