diff --git a/Makefile b/Makefile index aaa05a0c..9b5c0bab 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ifeq ($(shell id -u),0) endif # Tools + Environment -IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi; +IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi; source utils/environment.python.sh; env: virtualenv --python=python3 env # Install prjxray diff --git a/utils/environment.python.sh b/utils/environment.python.sh new file mode 100644 index 00000000..43a4706e --- /dev/null +++ b/utils/environment.python.sh @@ -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 diff --git a/utils/environment.sh b/utils/environment.sh index ac888429..f9dcbdfe 100644 --- a/utils/environment.sh +++ b/utils/environment.sh @@ -18,7 +18,7 @@ fi # misc export XRAY_PART_YAML="${XRAY_DATABASE_DIR}/${XRAY_DATABASE}/${XRAY_PART}/part.yaml" -export PYTHONPATH="${XRAY_DIR}:${XRAY_DIR}/third_party/fasm:$PYTHONPATH" +source $XRAY_UTILS_DIR/environment.python.sh # tools export XRAY_GENHEADER="${XRAY_UTILS_DIR}/genheader.sh"