Delete references to the Debian-bundled Python
We should now be able to use the rules_python version for everything.
There's no need to keep the old stuff around.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I75b1764d1d98c17832bfd0146c958db96d54ae48
diff --git a/tools/python/BUILD b/tools/python/BUILD
index 78203bc..8e410e5 100644
--- a/tools/python/BUILD
+++ b/tools/python/BUILD
@@ -1,11 +1,28 @@
load("@rules_python//python:defs.bzl", "py_runtime_pair")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
+# Invoke this via "bazel run //tools/python:requirements.update".
+compile_pip_requirements(
+ name = "requirements",
+ requirements_in = "requirements.txt",
+ requirements_txt = "requirements.lock.txt",
+ tags = [
+ # The test pings pypi.org to make sure that the lock file matches the
+ # requirements file.
+ "requires-network",
+ # The test causes some packages' setup.py to be executed which can
+ # execute arbitrary code. Sometimes they look for compilers etc. That's
+ # not good for our hermeticity assumptions. Disable the test lock file
+ # test for now.
+ "manual",
+ ],
+)
+
py_runtime(
name = "python3_runtime",
files = [
"runtime_binary.sh",
- "@python_repo//:all_files",
+ "@python3_9_x86_64-unknown-linux-gnu//:files",
],
interpreter = "runtime_binary.sh",
python_version = "PY3",
@@ -26,60 +43,11 @@
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
- "//tools/platforms/python:debian_bundled_python",
],
toolchain = ":py_runtime",
toolchain_type = "@rules_python//python:toolchain_type",
)
-# Invoke this via "bazel run //tools/python:requirements.update".
-compile_pip_requirements(
- name = "requirements",
- requirements_in = "requirements.txt",
- requirements_txt = "requirements.lock.txt",
- tags = [
- # The test pings pypi.org to make sure that the lock file matches the
- # requirements file.
- "requires-network",
- # The test causes some packages' setup.py to be executed which can
- # execute arbitrary code. Sometimes they look for compilers etc. That's
- # not good for our hermeticity assumptions. Disable the test lock file
- # test for now.
- "manual",
- ],
-)
-
-py_runtime(
- name = "upstream_python3_runtime",
- files = [
- "runtime_binary.sh",
- "@python3_9_x86_64-unknown-linux-gnu//:files",
- ],
- interpreter = "runtime_binary.sh",
- python_version = "PY3",
-)
-
-py_runtime_pair(
- name = "upstream_py_runtime",
- py2_runtime = None,
- py3_runtime = ":upstream_python3_runtime",
-)
-
-toolchain(
- name = "upstream_python_toolchain",
- exec_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:linux",
- ],
- target_compatible_with = [
- "@platforms//cpu:x86_64",
- "@platforms//os:linux",
- "//tools/platforms/python:upstream_bundled_python",
- ],
- toolchain = ":upstream_py_runtime",
- toolchain_type = "@rules_python//python:toolchain_type",
-)
-
py_binary(
name = "mirror_pip_packages",
srcs = ["mirror_pip_packages.py"],
diff --git a/tools/python/pip_configure.py b/tools/python/pip_configure.py
index 132cc24..349b945 100644
--- a/tools/python/pip_configure.py
+++ b/tools/python/pip_configure.py
@@ -64,9 +64,6 @@
name = "{requirement}",
deps = [requirement("{requirement}")],
visibility = ["//visibility:public"],
- target_compatible_with = [
- "@//tools/platforms/python:upstream_bundled_python",
- ],
)
"""))
diff --git a/tools/python/runtime_binary.sh b/tools/python/runtime_binary.sh
index 6dc34c1..d251a0b 100755
--- a/tools/python/runtime_binary.sh
+++ b/tools/python/runtime_binary.sh
@@ -29,12 +29,6 @@
LD_LIBRARY_PATH+=":${path}/../gtk_runtime/usr/lib"
export LD_LIBRARY_PATH
break
- elif [[ "$path" == *.runfiles/python_repo ]]; then
- PYTHON_BIN="$path"/usr/bin/python3
- LD_LIBRARY_PATH="${path}/lib/x86_64-linux-gnu:${path}/usr/lib:${path}/usr/lib/x86_64-linux-gnu:${path}/../matplotlib_repo/usr/lib"
- LD_LIBRARY_PATH+=":${path}/usr/lib/lapack:${path}/usr/lib/libblas:${path}/../matplotlib_repo/rpathed3/usr/lib:${path}/usr/lib/x86_64-linux-gnu/lapack:${path}/usr/lib/x86_64-linux-gnu/blas"
- export LD_LIBRARY_PATH
- break
fi
done