Also name the BUILD file in external repository roots BUILD.bazel#457
Also name the BUILD file in external repository roots BUILD.bazel#457hrfuller merged 2 commits intobazel-contrib:masterfrom
Conversation
|
This comment: #441 (comment) gives an example that fails on master but passes on this branch. |
| Returns: String of the PYTHONPATH. | ||
| """ | ||
| rctx.file("BUILD", "") | ||
| rctx.file("BUILD.bazel", "") |
There was a problem hiding this comment.
Can you move this line inside the else block here?
It shouldn't have been part of _construct_pypath in the first place, which was my mistake while refactoring. The root level BUILD.bazel file is only needed by pip_install. pip_parse already creates a root level BUILD.bazel in each repository via the extract_wheel function.
There was a problem hiding this comment.
Done in 6e92245.
The here link above links back to the comment, but I'm assuming you were referring to this else:
https://github.com/bazelbuild/rules_python/blob/master/python/pip_install/pip_repository.bzl#L82
I put it outside that conditional, since we do want the empty build file inside the repository where the requirements.bzl is generated-otherwise user code can't load from it. But it will be left out of the repositories for the individual packages still because it's not being injected here:
https://github.com/bazelbuild/rules_python/blob/master/python/pip_install/pip_repository.bzl#L215
There was a problem hiding this comment.
Thank you! Yes you read my mind. I was mixing up with whl_library invocation for that else block.
|
Thanks for reviewing @hrfuller. |
PR Checklist
Please check if your PR fulfills the following requirements:
.parfiles. See CONTRIBUTING.md for infoPR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #440
The build file in the repository roots generated by
pip_repositoryis stillBUILDand notBUILD.bazel. Sincepip_parsehas only one layer of directories, the external repository then ends up with aBUILDand aBUILD.bazel.What is the new behavior?
It's now called
BUILD.bazel, which meanspip_parselater overwrites it with the finalBUILD.bazel.Does this PR introduce a breaking change?
Other information
This prevents a regression of #427 with
pip_parse.