From c7033a6a19f4be906d5fc23c84548ee872c27f82 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Wed, 9 Sep 2020 09:40:53 -0700 Subject: [PATCH] Clean up python install process. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com> --- .github/kokoro/steps/hostsetup.sh | 1 + Makefile | 15 +++++---------- requirements.txt | 1 + utils/environment.python.sh | 2 -- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/kokoro/steps/hostsetup.sh b/.github/kokoro/steps/hostsetup.sh index 7f2948ed..9ce9f995 100755 --- a/.github/kokoro/steps/hostsetup.sh +++ b/.github/kokoro/steps/hostsetup.sh @@ -66,6 +66,7 @@ sudo apt-get install -y \ python3 \ python3-dev \ python3-virtualenv \ + python3-venv \ python3-yaml \ virtualenv \ diff --git a/Makefile b/Makefile index efe6deef..293407a4 100644 --- a/Makefile +++ b/Makefile @@ -18,18 +18,13 @@ endif # Tools + Environment IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi; source utils/environment.python.sh; env: - virtualenv --python=python3 env - # Install prjxray - ln -sf $(PWD)/prjxray env/lib/python3.*/site-packages/ - $(IN_ENV) python -c "import prjxray" - # Install fasm from third_party - $(IN_ENV) pip install --upgrade -e third_party/fasm - # Install sdfparse form third party - $(IN_ENV) pip install --upgrade -e third_party/python-sdf-timing + python3 -mvenv env # Install project dependencies - $(IN_ENV) pip install -r requirements.txt + $(IN_ENV) python -mpip install -r requirements.txt # Install project's documentation dependencies - $(IN_ENV) pip install -r docs/requirements.txt + $(IN_ENV) python -mpip install -r docs/requirements.txt + # Check that prjxray are available + $(IN_ENV) python -c "import prjxray" # Check fasm library was installed $(IN_ENV) python -c "import fasm" $(IN_ENV) python -c "import fasm.output" diff --git a/requirements.txt b/requirements.txt index 6fd01535..e10243ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -e third_party/fasm -e third_party/python-sdf-timing +-e . intervaltree junit-xml numpy diff --git a/utils/environment.python.sh b/utils/environment.python.sh index a4b8e382..06577010 100644 --- a/utils/environment.python.sh +++ b/utils/environment.python.sh @@ -1,4 +1,3 @@ -# FIXME: fasm should be installed into the running Python environment. # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style @@ -6,7 +5,6 @@ # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC -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