Fix dependencies in //frc971/control_loops/python
The rules_python toolchain is stricter about some of this stuff.
Switching to it revealed some misspecified dependencies. This patch
attempts to fix some of those dependencies.
Separately, quite a bit of code relies on Python's
hermeticity-breaking behaviour of adding the fully resolved path of
the file's directory to the import search path. That will be fixed in
a separate patch.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I9691cefec7e18834fa288d9e11b9817e87dac2c8
diff --git a/frc971/control_loops/python/BUILD b/frc971/control_loops/python/BUILD
index f3dcb48..ef7b31b 100644
--- a/frc971/control_loops/python/BUILD
+++ b/frc971/control_loops/python/BUILD
@@ -1,5 +1,23 @@
package(default_visibility = ["//visibility:public"])
+py_library(
+ name = "constants",
+ srcs = ["constants.py"],
+ deps = [
+ "@pip//pygobject",
+ ],
+)
+
+py_library(
+ name = "drawing_constants",
+ srcs = ["drawing_constants.py"],
+ deps = [
+ ":color",
+ "@pip//numpy",
+ "@pip//pygobject",
+ ],
+)
+
py_binary(
name = "haptic_wheel",
srcs = [
@@ -154,7 +172,6 @@
py_binary(
name = "spline_graph",
srcs = [
- "color.py",
"graph.py",
"multispline.py",
"path_edit.py",
@@ -171,6 +188,9 @@
visibility = ["//visibility:public"],
deps = [
":basic_window",
+ ":color",
+ ":constants",
+ ":drawing_constants",
":libspline",
":python_init",
"@matplotlib_repo//:matplotlib3",
@@ -182,11 +202,11 @@
name = "basic_window",
srcs = [
"basic_window.py",
- "color.py",
],
target_compatible_with = ["@platforms//cpu:x86_64"],
visibility = ["//visibility:public"],
deps = [
+ ":constants",
":python_init",
"@python_gtk",
],