Migrate everything to upstream pip packages

This patch migrates all the Python packages I could find to the
packages provided by rules_python. It's possible that there are some
that I missed. In that case, the finder will have to migrate it on
their own.

A future patch will remove the remaining references to the
Debian-packaged Python packages in future patches. This patch here is
solely focused on migrating the existing users.

Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ic7a8ba6110516aa2446ad2ad4e2495fab62d824c
diff --git a/debian/glog.BUILD b/debian/glog.BUILD
index 8de9b80..091a966 100644
--- a/debian/glog.BUILD
+++ b/debian/glog.BUILD
@@ -5,6 +5,6 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//external:python-gflags",
+        "@pip//python_gflags",
     ],
 )
diff --git a/debian/matplotlib.bzl b/debian/matplotlib.bzl
index 4e9feb8..dfb2591 100644
--- a/debian/matplotlib.bzl
+++ b/debian/matplotlib.bzl
@@ -204,6 +204,6 @@
         ],
         visibility = ["//visibility:public"],
         deps = [
-            "@python_repo//:numpy",
+            "@pip//numpy",
         ],
     )
diff --git a/debian/opencv_python.BUILD b/debian/opencv_python.BUILD
index 8d2ef2a..f4911ab 100644
--- a/debian/opencv_python.BUILD
+++ b/debian/opencv_python.BUILD
@@ -11,6 +11,6 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "@python_repo//:numpy",
+        "@pip//numpy",
     ],
 )
diff --git a/debian/osqp_python.BUILD b/debian/osqp_python.BUILD
index b790a75..72eafab 100644
--- a/debian/osqp_python.BUILD
+++ b/debian/osqp_python.BUILD
@@ -11,8 +11,8 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "@python_repo//:numpy",
-        "@python_repo//:scipy",
+        "@pip//numpy",
+        "@pip//scipy",
         "@qdldl_amd64//:python_qdldl",
     ],
 )
diff --git a/debian/python.BUILD b/debian/python.BUILD
index 803e4bd..86a3e5d 100644
--- a/debian/python.BUILD
+++ b/debian/python.BUILD
@@ -10,7 +10,10 @@
         "usr/include/",
         "usr/include/python3.9/",
     ],
-    target_compatible_with = ["@platforms//cpu:x86_64"],
+    target_compatible_with = [
+        "@platforms//cpu:x86_64",
+        "@//tools/platforms/python:debian_bundled_python",
+    ],
     visibility = ["//visibility:public"],
 )
 
@@ -29,6 +32,9 @@
     includes = [
         "usr/lib/python3/dist-packages/numpy/f2py/src/",
     ],
+    target_compatible_with = [
+        "@//tools/platforms/python:debian_bundled_python",
+    ],
     visibility = ["//visibility:public"],
     deps = [
         ":python3.9_lib",
diff --git a/debian/qdldl_python.BUILD b/debian/qdldl_python.BUILD
index d270029..4120154 100644
--- a/debian/qdldl_python.BUILD
+++ b/debian/qdldl_python.BUILD
@@ -11,7 +11,7 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "@python_repo//:numpy",
-        "@python_repo//:scipy",
+        "@pip//numpy",
+        "@pip//scipy",
     ],
 )