Skip to content

Commit

Permalink
Fix WORKSPACE/distro boilerplate (bazelbuild#238)
Browse files Browse the repository at this point in the history
We don't have a toolchain method, so don't try to call one in WORKSPACE. Add
optional pip_repositories() call to README and add note that relnotes need
manual editing for this.
  • Loading branch information
brandjon authored Oct 9, 2019
1 parent 9150caa commit 5aa465d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ http_archive(
url = "https://github.com/bazelbuild/rules_python/releases/download/<RELEASE>/rules_python-<RELEASE>.tar.gz",
sha256 = "<SHA>",
)
load("@rules_python//python:repositories.bzl", "py_repositories", "rules_python_toolchains")
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
rules_python_toolchains()
# Only needed if using the packaging rules.
load("@rules_python//python:pip.bzl", "pip_repositories")
pip_repositories()
```

Otherwise, you may import rules_python in a standalone way by copying the
Expand All @@ -63,10 +65,9 @@ git_repository(
# NOT VALID: Replace with actual Git commit SHA.
commit = "{HEAD}",
)
# This call should always be present.
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
# This one is only needed if you're using the packaging rules.
# Only needed if using the packaging rules.
load("@rules_python//python:pip.bzl", "pip_repositories")
pip_repositories()
```
Expand Down
4 changes: 3 additions & 1 deletion distro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ pkg_tar(
strip_prefix = ".",
)

# TODO(brandjon): print_rel_notes doesn't appear to handle our use case of
# emitting an optional additional deps method from a different file. For now we
# manually adjust our release notes.
print_rel_notes(
name = "relnotes",
outs = ["relnotes.txt"],
deps_method = "py_repositories",
repo = "rules_python",
setup_file = "python:repositories.bzl",
toolchains_method = "rules_python_toolchains",
version = version,
)

0 comments on commit 5aa465d

Please sign in to comment.