Closed vadikmironov closed 1 week ago
This isn't a rules_mypy error, this is coming from your module:
Error in fail: Duplicate cross-module pip hub named 'pip_deps': pip hub names must be unique across modules. First defined by module '', second attempted by module 'protobuf'
I believe the empty string here is your root repo, and the other is coming from protobuf. You can fix by renaming pip_deps
in your project's MODULE.bazel (I'm not sure if protobuf has been fixed for this). Otherwise I would report to rules_python. I assume it's because of this change: https://github.com/bazelbuild/rules_python//commit/38b5ac068c83f382f98e336dbd7390a66e44ae33 but I'm not sure if it was intentional or not
Thanks a lot! Protobuf master still contains this particular name: https://github.com/protocolbuffers/protobuf/blob/main/MODULE.bazel#L72 and it all makes sense now. I initially was confused by the fact that switching off rules_mypy was hiding the problem, but now it's clearer as to why.
First of all, huge thank you to both @keith and @mark-thm for version 0.14.0 of rules_mypy which solves python binary/library imports very nicely indeed. However, the setup that nicely worked lasted only until the release of rules_python 0.39.0. With the configuration identical to the one described in rules_mypy documentation following the upgrade to 0.39.0 bazel started to fail with the following:
aspect.bzl content is exactly as per rules_mypy docs. rules_python up to 0.38.0 works perfectly fine. Here is the changelog which to my untrained eye does not contain anything suspicious: https://github.com/bazelbuild/rules_python/compare/0.38.0...0.39.0
Let me know if this does not look like rules_mypy issue and shall be posted to rules_python instead.