Skip to content

Relax Cannot generate Python code for a .proto whose path contains '-' check #1924

Closed
@keith

Description

@keith

With bzlmod many repos now use their github repo name as the module name, instead of the previous com_github_whatever convention. Because of this you might end up with dashes in a name, and no matter what repo_name you give it in your MODULE.bazel the underlying path will be the canonical module name. Because of this if you have a repo like protoc-gen-validate and try to use a python proto from it, it fails when you include it as a third party dependency, but not when you build in that repo directly with this error:

https://github.com/bazelbuild/rules_python/blob/6ca2f58bedca519f5ea6431ad7e11aaac84415c0/python/private/proto/py_proto_library.bzl#L61-L64

Would it be possible for the check to only apply to the relative path in the repo, excluding the repo name itself? I don't believe the repo name should appear in the import path, so I think that would be safe?

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