diff --git a/.bazelversion b/.bazelversion index c6b7980b68..512e4c889e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.x +9.x diff --git a/MODULE.bazel b/MODULE.bazel index 326bb5b78e..a8af3be582 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -226,7 +226,7 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True) # Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests. # We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides. -bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go") +bazel_dep(name = "rules_go", version = "0.60.0", dev_dependency = True, repo_name = "io_bazel_rules_go") internal_dev_deps = use_extension( "//python/private:internal_dev_deps.bzl", diff --git a/examples/bzlmod/.bazelversion b/examples/bzlmod/.bazelversion index 35907cd9ca..512e4c889e 100644 --- a/examples/bzlmod/.bazelversion +++ b/examples/bzlmod/.bazelversion @@ -1 +1 @@ -7.x +9.x diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 0fb8e88135..e7dbef65d8 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -1,6 +1,4 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@rules_shell//shell:sh_test.bzl", "sh_test") -load("//:version.bzl", "BAZEL_VERSION") package(default_visibility = ["//visibility:public"]) @@ -27,29 +25,3 @@ build_test( "//python/entry_points:py_console_script_binary_bzl", ], ) - -genrule( - name = "assert_bazelversion", - srcs = ["//:.bazelversion"], - outs = ["assert_bazelversion_test.sh"], - cmd = """\ -set -o errexit -o nounset -o pipefail -current=$$(cat "$(execpath //:.bazelversion)") -cat > "$@" <&2 echo "ERROR: current bazel version '$${{current}}' is not the expected '{expected}'" - exit 1 -fi -EOF -""".format( - expected = BAZEL_VERSION, - ), - executable = True, -) - -sh_test( - name = "assert_bazelversion_test", - srcs = [":assert_bazelversion_test.sh"], -) diff --git a/tests/integration/local_toolchains/BUILD.bazel b/tests/integration/local_toolchains/BUILD.bazel index bf47316027..20ee7bcfe6 100644 --- a/tests/integration/local_toolchains/BUILD.bazel +++ b/tests/integration/local_toolchains/BUILD.bazel @@ -24,7 +24,10 @@ py_test( "//:py": "local", }, # Make this test better respect pyenv - env_inherit = ["PYENV_VERSION"], + env_inherit = [ + "PYENV_VERSION", + "PATH", + ], ) py_test( diff --git a/tests/integration/local_toolchains/local_runtime_test.py b/tests/integration/local_toolchains/local_runtime_test.py index 0a0d6bedeb..220ceaead4 100644 --- a/tests/integration/local_toolchains/local_runtime_test.py +++ b/tests/integration/local_toolchains/local_runtime_test.py @@ -16,15 +16,20 @@ def test_python_from_path_used(self): # that wouldn't be reflected when sub-shells are run later. shell_path = shutil.which("python3") + if shell_path is None: + self.fail( + "which(python3) returned None.\n" + f"PATH={os.environ.get('PATH')}" + ) + # We call the interpreter and print its executable because of # things like pyenv: they install a shim that re-execs python. # The shim is e.g. /home/user/.pyenv/shims/python3, which then # runs e.g. /usr/bin/python3 with tempfile.TemporaryDirectory() as temp_dir: file_path = os.path.join(temp_dir, "info.py") - with open(file_path, 'w') as f: + with open(file_path, "w") as f: f.write( - """ + """ import sys print(sys.executable) print(sys._base_executable)