Skip to content

Commit d09d60c

Browse files
UebelAndrealexeaglehrfuller
authored
Updated min tested Bazel version to 4.0.0 (#533)
* Updated min tested Bazel version to 4.0.0 * Assert that Bazel is at least 4.0.0 LTS Since we only test against bazel 4.0 now, and will start using features that require it, this gives users an obvious error message that they need to update. * Add third_party bzl files to integration test rules_python distro * remove helloworld test that relies on python2 Co-authored-by: Alex Eagle <[email protected]> Co-authored-by: Henry Fuller <[email protected]>
1 parent 86e7135 commit d09d60c

File tree

14 files changed

+173
-119
lines changed

14 files changed

+173
-119
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.1
1+
4.0.0

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
*~
3333

3434
# Bazel directories
35-
bazel-*
36-
bazel-bin
37-
bazel-genfiles
38-
bazel-out
39-
bazel-testlogs
35+
/bazel-*
36+
/bazel-bin
37+
/bazel-genfiles
38+
/bazel-out
39+
/bazel-testlogs
4040

4141
# vim swap files
4242
*.swp

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ filegroup(
2929
"internal_setup.bzl",
3030
"//python:distribution",
3131
"//python/pip_install:distribution",
32+
"//third_party/github.com/bazelbuild/bazel-skylib/lib:distribution",
3233
"//tools:distribution",
3334
],
3435
visibility = ["//distro:__pkg__"],

docs/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ stardoc(
8484
deps = [
8585
":bazel_repo_tools",
8686
":pip_install_bzl",
87+
"//third_party/github.com/bazelbuild/bazel-skylib/lib:versions",
8788
],
8889
)
8990

examples/legacy_pip_import/WORKSPACE

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ load("@rules_python//python/legacy_pip_import:pip.bzl", "pip_import", "pip_repos
1212

1313
pip_repositories()
1414

15-
pip_import(
16-
name = "helloworld_deps",
17-
requirements = "//helloworld:requirements.txt",
18-
)
19-
20-
load("@helloworld_deps//:requirements.bzl", _helloworld_install = "pip_install")
21-
22-
_helloworld_install()
23-
2415
pip_import(
2516
name = "boto_deps",
2617
requirements = "//boto:requirements.txt",

examples/legacy_pip_import/helloworld/BUILD

Lines changed: 0 additions & 33 deletions
This file was deleted.

examples/legacy_pip_import/helloworld/helloworld.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/legacy_pip_import/helloworld/helloworld_test.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

examples/legacy_pip_import/helloworld/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

python/pip_install/repositories.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
55

6+
# Avoid a load from @bazel_skylib repository as users don't necessarily have it installed
7+
load("//third_party/github.com/bazelbuild/bazel-skylib/lib:versions.bzl", "versions")
8+
69
_RULE_DEPS = [
710
(
811
"pypi__click",
@@ -63,6 +66,13 @@ def pip_install_dependencies():
6366
6467
(However we call it from pip_install, making it optional for users to do so.)
6568
"""
69+
70+
# We only support Bazel LTS and rolling releases.
71+
# Give the user an obvious error to upgrade rather than some obscure missing symbol later.
72+
# It's not guaranteed that users call this function, but it's used by all the pip fetch
73+
# repository rules so it's likely that most users get the right error.
74+
versions.check("4.0.0")
75+
6676
for (name, url, sha256) in _RULE_DEPS:
6777
maybe(
6878
http_archive,

0 commit comments

Comments
 (0)