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/debian/opencv_python.BUILD b/debian/opencv_python.BUILD
index 5afa180..5074bd3 100644
--- a/debian/opencv_python.BUILD
+++ b/debian/opencv_python.BUILD
@@ -5,6 +5,9 @@
include = ["**/*"],
exclude = ["**/*.py"],
),
+ deps = [
+ "@python_repo//:numpy",
+ ],
imports = ["."],
visibility = ["//visibility:public"],
)