Use a (mostly) hermetic Python interpreter
It still requires python to be installed on the host to run the wrapper
scripts, but it's close to being fully hermetic.
This also requires/enables the following changes, unfortunately all at
the same time:
* Use a downloaded f2py
* Use a downloaded scipy/numpy/matplotlib
* Fix a few things that don't run with the python version in their #!
* Stop using bazel-generated __init__.py files, because those interfere
with importing matplotlib nicely
Change-Id: Ife280464613d67cece9587b7d947f0b1d5466d7e
diff --git a/motors/python/BUILD b/motors/python/BUILD
index 408f3cd..903b397 100644
--- a/motors/python/BUILD
+++ b/motors/python/BUILD
@@ -3,8 +3,10 @@
srcs = [
"big_phase_current.py",
],
+ legacy_create_init = False,
restricted_to = ["//tools:k8"],
deps = [
+ ":python_init",
"//external:python-gflags",
"//external:python-glog",
"//frc971/control_loops/python:controls",
@@ -16,10 +18,19 @@
srcs = [
"haptic_phase_current.py",
],
+ legacy_create_init = False,
restricted_to = ["//tools:k8"],
deps = [
+ ":python_init",
"//external:python-gflags",
"//external:python-glog",
"//frc971/control_loops/python:controls",
],
)
+
+py_library(
+ name = "python_init",
+ srcs = ["__init__.py"],
+ visibility = ["//visibility:public"],
+ deps = ["//motors:python_init"],
+)
diff --git a/motors/python/__init__.py b/motors/python/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/motors/python/__init__.py