Skip to content

Commit 5aa465d

Browse files
authored
Fix WORKSPACE/distro boilerplate (bazel-contrib#238)
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.
1 parent 9150caa commit 5aa465d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ http_archive(
4747
url = "https://github.com/bazelbuild/rules_python/releases/download/<RELEASE>/rules_python-<RELEASE>.tar.gz",
4848
sha256 = "<SHA>",
4949
)
50-
load("@rules_python//python:repositories.bzl", "py_repositories", "rules_python_toolchains")
50+
load("@rules_python//python:repositories.bzl", "py_repositories")
5151
py_repositories()
52-
rules_python_toolchains()
52+
# Only needed if using the packaging rules.
53+
load("@rules_python//python:pip.bzl", "pip_repositories")
54+
pip_repositories()
5355
```
5456

5557
Otherwise, you may import rules_python in a standalone way by copying the
@@ -63,10 +65,9 @@ git_repository(
6365
# NOT VALID: Replace with actual Git commit SHA.
6466
commit = "{HEAD}",
6567
)
66-
# This call should always be present.
6768
load("@rules_python//python:repositories.bzl", "py_repositories")
6869
py_repositories()
69-
# This one is only needed if you're using the packaging rules.
70+
# Only needed if using the packaging rules.
7071
load("@rules_python//python:pip.bzl", "pip_repositories")
7172
pip_repositories()
7273
```

distro/BUILD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ pkg_tar(
2121
strip_prefix = ".",
2222
)
2323

24+
# TODO(brandjon): print_rel_notes doesn't appear to handle our use case of
25+
# emitting an optional additional deps method from a different file. For now we
26+
# manually adjust our release notes.
2427
print_rel_notes(
2528
name = "relnotes",
2629
outs = ["relnotes.txt"],
2730
deps_method = "py_repositories",
2831
repo = "rules_python",
2932
setup_file = "python:repositories.bzl",
30-
toolchains_method = "rules_python_toolchains",
3133
version = version,
3234
)

0 commit comments

Comments
 (0)