blob: 1de566d2ba4af68ec82f259f7243e00b072a8876 [file] [log] [blame]
Jeremy Johnson2ec34942021-12-14 16:34:05 +00001# 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
11if [ -z "$VIRTUAL_ENV" ]; then
12 echo "Please source this within a python virtual env"
13 return
14fi
15
16if [ -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 Johnson6c6467f2022-05-17 15:30:56 +010020 pip install pytest
Jeremy Johnson2ec34942021-12-14 16:34:05 +000021 export PYTHONPATH="$SCRIPTS_DIR:$REFMODEL_DIR/thirdparty/serialization_lib/python"
22 echo "Set PYTHONPATH=$PYTHONPATH"
23else
24 echo "Please source this using bash"
25fi