fix: various py_proto_library fixes
- Adds blacklisting of the well-known types in the python runtime provided by the toolchain/runtime, as this can cause duplicate generation of these protos in some cases. This conditionally tries to use proto_common.experimental_should_generate_code if it can since this API isn't necessarily stable
- Tweaks how the runtime provided protos are injected in the runfiles, the current mechanism collects and propagates this in the aspect but it seems unnecessary, as this can just be done in the terminal rule once
- Adds proper import prefixing/stripping support, including in external repos
- Adds various unit tests that verify various import prefixing/stripping and external repo import combinations
not really sure why buildifier is failing in the tests...the file looks fine to me and my local buildifier is not complaining
@chancila here you go:
##### :bazel: buildifier: found 1 format issue in your WORKSPACE, BUILD and *.bzl files
--
| If this repo uses a pre-commit hook, then you should install it. Otherwise, please download <a href="https://github.com/bazelbuild/buildtools/releases/tag/6.1.0">buildifier 6.1.0</a> and run the following command in your workspace:<br/><pre><code>buildifier examples/py_proto_library/external_workspace/BUILD.bazel</code></pre>
| ##### :bazel: buildifier: found 1 lint issue in your WORKSPACE, BUILD and *.bzl files
| <pre><code><a href="https://github.com/chancila/rules_python/blob/98accb2de842a597da41f5c6d904f88852142d41/python/private/proto/py_proto_library.bzl#L235">python/private/proto/py_proto_library.bzl:235:9</a>: <a href="https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#unsorted-dict-items">unsorted-dict-items</a>: Dictionary items are out of their lexicographical order.</pre></code>
| Uploading output via 'buildkite annotate'
So the way I got this information is to go to the buildifier failing test and then expand this section:
🛠️ Printing raw output for debugging
I also have a hacked version of buildifier.py that I use locally. It gives me "most" of the errors, but not all of them always.
This Pull Request has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
This PR was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"