utils: Support global python environment settings.

* Move Python environment values into `utils/environment.python.sh`
 * Source the `utils/environment.python.sh` before running Python
   scripts.
 * Add `DeprecationWarning` suppression for `distutils`

Now the output of `make test-py` returns `30 passed in N.NNs` instead of
the previous `30 passed, 1 warnings in N.NNs`

Signed-off-by: Tim 'mithro' Ansell <[email protected]>
This commit is contained in:
Tim 'mithro' Ansell
2020-02-18 10:27:08 -08:00
parent f4368e62e5
commit 5165df03fe
3 changed files with 8 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
# FIXME: fasm should be installed into the running Python environment.
export PYTHONPATH="${XRAY_DIR}:${XRAY_DIR}/third_party/fasm:$PYTHONPATH"
# Suppress the following warnings;
# - env/lib/python3.7/distutils/__init__.py:4: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
export PYTHONWARNINGS=ignore::DeprecationWarning:distutils