-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also name the BUILD file in external repository roots BUILD.bazel #457
Conversation
This comment: #441 (comment) gives an example that fails on master but passes on this branch. |
@@ -12,7 +12,7 @@ def _construct_pypath(rctx): | |||
rctx: Handle to the repository_context. | |||
Returns: String of the PYTHONPATH. | |||
""" | |||
rctx.file("BUILD", "") | |||
rctx.file("BUILD.bazel", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
.par
files. 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_repository
is stillBUILD
and notBUILD.bazel
. Sincepip_parse
has only one layer of directories, the external repository then ends up with aBUILD
and aBUILD.bazel
.What is the new behavior?
It's now called
BUILD.bazel
, which meanspip_parse
later overwrites it with the finalBUILD.bazel
.Does this PR introduce a breaking change?
Other information
This prevents a regression of #427 with
pip_parse
.