| commit | 2a5ba18d60b25e10b99d0fa87b1da51f40d9f0d3 | [log] [tgz] |
|---|---|---|
| author | Alex Torok <alext9@gmail.com> | Wed Aug 28 04:12:49 2024 -0400 |
| committer | GitHub <noreply@github.com> | Wed Aug 28 08:12:49 2024 +0000 |
| tree | c531eee82dd1c36f66a6f3186a1c92219df82675 | |
| parent | 636105772e5264ed2564b627ff4d09b40532f3c3 [diff] |
fix(gazelle): Correctly resolve deps that have top-level module overlap with a gazelle_python.yaml dep module (#2160) In https://github.com/bazelbuild/rules_python/pull/2048, `FindThirdPartyDependency` was updated to walk up the module import path to try to find a match in gazelle_python.yaml. This is unnecessary, as the main resolve loop will accomplish the same task. Additionally, the change broke the ability to configure a more specific resolve override or resolve more specific indexed libraries. For a real-world example of where this is a problem, `pytype` has a `third_party` module at its top-level. In a repo that also has a `third_party` directory, we can no longer resolve our indexed libraries in `third_party`. When the resolve loop tried to resolve `third_party.foo.bar`, `FindThirdPartyDependency` will immediately match `third_party` and not give the resolve loop a chance to look in the rule index for `third_party.foo.bar`. The same issue appears for providing overrides that are more specific (see the updated testcase). This PR reverts the change to FindThirdPartyDependency and updates the testcases to ensure that we can still resolve specific indexed packages, explicit resolve overrides, and third party modules even when there is an overlap in the top-level module name.
This repository is the home of the core Python rules -- py_library, py_binary, py_test, py_proto_library, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.