Start migrating to upstream pip package management
Rather than packaging up Debian packages, we can start using upstream
wheels.
There are still some issues to figure out. The biggest one is how to
make the upstream packages reproducible. Some packages like numpy are
distributed as wheels which should address the majority of concerns.
Some packages are only distributed in source form though. Those will
be compiled by rules_python against the host system. We'll need to
find a better way to deal with those.
For now you can use the new Python setup if you use
`--config=k8_upstream_python`. Once the majority of the issues are
fixed, I will get rid of the special casing. Then you'll only need
`--config=k8`.
Change-Id: I982ea057e0f47cdfda3d11d58275d7c07e34975a
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
diff --git a/debian/matplotlib.bzl b/debian/matplotlib.bzl
index 3572639..4e9feb8 100644
--- a/debian/matplotlib.bzl
+++ b/debian/matplotlib.bzl
@@ -198,7 +198,10 @@
".",
"usr/lib/python" + tkinter_py_version,
],
- target_compatible_with = ["@platforms//cpu:x86_64"],
+ target_compatible_with = [
+ "@platforms//cpu:x86_64",
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
deps = [
"@python_repo//:numpy",
diff --git a/debian/opencv_python.BUILD b/debian/opencv_python.BUILD
index 281564b..8d2ef2a 100644
--- a/debian/opencv_python.BUILD
+++ b/debian/opencv_python.BUILD
@@ -6,6 +6,9 @@
exclude = ["**/*.py"],
),
imports = ["."],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
deps = [
"@python_repo//:numpy",
diff --git a/debian/osqp_python.BUILD b/debian/osqp_python.BUILD
index 9d3260e..b790a75 100644
--- a/debian/osqp_python.BUILD
+++ b/debian/osqp_python.BUILD
@@ -6,6 +6,9 @@
exclude = ["**/*.py"],
),
imports = ["."],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
deps = [
"@python_repo//:numpy",
diff --git a/debian/python.BUILD b/debian/python.BUILD
index 1a876f1..803e4bd 100644
--- a/debian/python.BUILD
+++ b/debian/python.BUILD
@@ -75,6 +75,7 @@
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
+ "@//tools/platforms/python:debian_bundled_python",
],
visibility = ["//visibility:public"],
deps = [
@@ -101,6 +102,7 @@
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
+ "@//tools/platforms/python:debian_bundled_python",
],
visibility = ["//visibility:public"],
)
diff --git a/debian/python_gtk.BUILD b/debian/python_gtk.BUILD
index 7fdb3b9..226d17a 100644
--- a/debian/python_gtk.BUILD
+++ b/debian/python_gtk.BUILD
@@ -163,6 +163,9 @@
"usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders",
],
imports = ["usr/lib/python3/dist-packages"],
- target_compatible_with = ["@platforms//cpu:x86_64"],
+ target_compatible_with = [
+ "@platforms//cpu:x86_64",
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
)
diff --git a/debian/python_jinja2.BUILD b/debian/python_jinja2.BUILD
index 1adab6a..5e564c9 100644
--- a/debian/python_jinja2.BUILD
+++ b/debian/python_jinja2.BUILD
@@ -2,6 +2,9 @@
name = "python_jinja2",
srcs = glob(["src/jinja2/*.py"]),
imports = ["src/"],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
deps = ["@python_markupsafe"],
)
diff --git a/debian/python_markupsafe.BUILD b/debian/python_markupsafe.BUILD
index 87f10ea..af6cf56 100644
--- a/debian/python_markupsafe.BUILD
+++ b/debian/python_markupsafe.BUILD
@@ -2,5 +2,8 @@
name = "python_markupsafe",
srcs = glob(["src/markupsafe/*.py"]),
imports = ["src/"],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
)
diff --git a/debian/python_yapf.BUILD b/debian/python_yapf.BUILD
index c41558c..ad06576 100644
--- a/debian/python_yapf.BUILD
+++ b/debian/python_yapf.BUILD
@@ -2,5 +2,8 @@
name = "python_yapf",
srcs = glob(["yapf/**/*.py"]),
main = "yapf/__main__.py",
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
)
diff --git a/debian/qdldl_python.BUILD b/debian/qdldl_python.BUILD
index 76d647e..d270029 100644
--- a/debian/qdldl_python.BUILD
+++ b/debian/qdldl_python.BUILD
@@ -6,6 +6,9 @@
exclude = ["**/*.py"],
),
imports = ["."],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
deps = [
"@python_repo//:numpy",
diff --git a/debian/six.BUILD b/debian/six.BUILD
index 3d8ffd4..921bffb 100644
--- a/debian/six.BUILD
+++ b/debian/six.BUILD
@@ -3,5 +3,8 @@
srcs = [
"six.py",
],
+ target_compatible_with = [
+ "@//tools/platforms/python:debian_bundled_python",
+ ],
visibility = ["//visibility:public"],
)