Jeremy Johnson | 2ec3494 | 2021-12-14 16:34:05 +0000 | [diff] [blame] | 1 | # Copyright (c) 2021-2022 Arm Limited. |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| 4 | # Source this script to install the python tosa tools as editable: |
| 5 | # . scripts/py-dev-env.bash |
| 6 | |
| 7 | # NOTE: This script is needed to fix up PYTHONPATH due to a bug |
| 8 | # in setuptools that does not support multiple package_dirs |
| 9 | # properly: https://github.com/pypa/setuptools/issues/230 |
| 10 | |
| 11 | if [ -z "$VIRTUAL_ENV" ]; then |
| 12 | echo "Please source this within a python virtual env" |
| 13 | return |
| 14 | fi |
| 15 | |
| 16 | if [ -e "${BASH_SOURCE[0]}" ]; then |
| 17 | SCRIPTS_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}")) |
| 18 | REFMODEL_DIR=$(dirname "$SCRIPTS_DIR") |
| 19 | pip install -e "$REFMODEL_DIR" |
Jeremy Johnson | 6c6467f | 2022-05-17 15:30:56 +0100 | [diff] [blame] | 20 | pip install pytest |
Jeremy Johnson | 2ec3494 | 2021-12-14 16:34:05 +0000 | [diff] [blame] | 21 | export PYTHONPATH="$SCRIPTS_DIR:$REFMODEL_DIR/thirdparty/serialization_lib/python" |
| 22 | echo "Set PYTHONPATH=$PYTHONPATH" |
| 23 | else |
| 24 | echo "Please source this using bash" |
| 25 | fi |