8000 Remove py_repositories (#370) · bazel-contrib/rules_python@5be1f76 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5be1f76

Browse files
authored
Remove py_repositories (#370)
This adds useless setup code to a users WORKSPACE file. The idea that we could add some transitive WORKSPACE dependencies is flawed without a working support for this in Bazel. Anything we add in that function later is a breaking change for users, in that they might call our py_repositories() before fetching rules_xx, and we already installed an incompatible rules_xx. Since adding anything here is a breaking change, we can always put it back later as a breaking change to the rules. However I would argue strongly that rules_python is too core in the dependency chain for it to *ever* grow transitive dependencies. Like rules_nodejs we should either vendor code we need privately or strip development-only dependencies from our distribution, and never suggest that users call a rules_python function that installs other starlark code.
1 parent 69f55c1 commit 5be1f76

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ http_archive(
8686
strip_prefix = "rules_python-{}".format(rules_python_version),
8787
url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version),
8888
)
89-
90-
# Then load and call py_repositories() as
91-
# above.
9289
```
9390

9491
Once you've imported the rule set into your `WORKSPACE` using any of these

distro/BU 8000 ILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pkg_tar(
2828
print_rel_notes(
2929
name = "relnotes",
3030
outs = ["relnotes.txt"],
31-
deps_method = "py_repositories",
3231
repo = "rules_python",
3332
setup_file = "python:repositories.bzl",
3433
version = version,

examples/pip_install/WORKSPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ http_archive(
88
sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
99
)
1010

11-
load("@rules_python//python:repositories.bzl", "py_repositories")
12-
13-
py_repositories()
14-
1511
load("@rules_python//python:pip.bzl", "pip_install")
1612

1713
pip_install(

python/repositories.bzl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,5 @@ For historic reasons, pip_repositories() is defined in //python:pip.bzl.
44
"""
55

66
def py_repositories():
7-
"""Pull in dependencies needed to use the core Python rules."""
8-
9-
# At the moment this is a placeholder hook, in that it does not actually
10-
# pull in any dependencies. Users should still call this function to make
11-
# it less likely that they need to update their WORKSPACE files, in case
12-
# this function is changed in the future.
13-
pass
7+
# buildifier: disable=print
8+
print("py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file")

0 commit comments

Comments
 (0)
0