8000 `requirements.bzl` is now visible outside `pip_repository`s by UebelAndre · Pull Request #463 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content

requirements.bzl is now visible outside pip_repositorys #463

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

Merged
merged 2 commits into from
Apr 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/pip_install/pip_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ def _parse_optional_attrs(rctx, args):

return args

_BUILD_FILE_CONTENTS = """\
package(default_visibility = ["//visibility:public"])

# Ensure the `requirements.bzl` source can be accessed by stardoc, since users load() from it
exports_files(["requirements.bzl"])
"""

def _pip_repository_impl(rctx):
python_interpreter = rctx.attr.python_interpreter
if rctx.attr.python_interpreter_target != None:
Expand All @@ -64,7 +71,7 @@ def _pip_repository_impl(rctx):
fail("Incremental mode requires a requirements_lock attribute be specified.")

# We need a BUILD file to load the generated requirements.bzl
rctx.file("BUILD.bazel", "")
rctx.file("BUILD.bazel", _BUILD_FILE_CONTENTS)

pypath = _construct_pypath(rctx)

Expand Down
0