Prevent Python from importing the host's pip packages
This patch prevents Python from searching the user's installed pip
packages as well as the host's `site` package. The host's `site`
package normally performs the setup necessary to allow importing
globally installed pip packages. We don't want that.
From the upstream documentation:
https://docs.python.org/3/using/cmdline.html
-s
Don’t add the user site-packages directory to sys.path.
See also PEP 370 – Per user site-packages directory
-S
Disable the import of the module site and the
site-dependent manipulations of sys.path that it
entails. Also disable these manipulations if site is
explicitly imported later (call site.main() if you
want them to be triggered).
Change-Id: I11a64c33920fc174dd8ac5d200e2e8550a3c084a
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
diff --git a/y2020/vision/tools/python_code/BUILD b/y2020/vision/tools/python_code/BUILD
index 1e27f65..7579a75 100644
--- a/y2020/vision/tools/python_code/BUILD
+++ b/y2020/vision/tools/python_code/BUILD
@@ -4,12 +4,10 @@
py_library(
name = "train_and_match",
srcs = ["train_and_match.py"],
- data = [
- "@python_repo//:scipy",
- ],
deps = [
"//external:python-glog",
"@opencv_contrib_nonfree_amd64//:python_opencv",
+ "@python_repo//:scipy",
],
)
@@ -18,13 +16,11 @@
srcs = [
"define_training_data.py",
],
- data = [
- "@python_repo//:scipy",
- ],
deps = [
":train_and_match",
"//external:python-glog",
"@opencv_contrib_nonfree_amd64//:python_opencv",
+ "@python_repo//:scipy",
],
)