Skip to content

Commit

Permalink
[script] venv activation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EskoDijk committed Jun 4, 2024
1 parent fdd86d6 commit 9b1e405
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ build_openthread_versions()
./script/build_all "$(get_build_options)"
)
}

activate_python_venv()
{
source .venv-otns/bin/activate
}
2 changes: 1 addition & 1 deletion script/install
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install_otns()

install_pyotns()
{
source .venv-otns/bin/activate
activate_python_venv
cd pylibs
python3 -m pip install .
# python3 setup.py install --user --prefix= 2>/dev/null # alternative - fails on macos-14
Expand Down
2 changes: 1 addition & 1 deletion script/install-deps
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ install_python_libs()
if [ ! -d .venv-otns ]; then
python3 -m venv .venv-otns
fi
source .venv-otns/bin/activate
activate_python_venv
python3 -m pip install setuptools
}

Expand Down
4 changes: 4 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ install_otns()
py_unittests()
{
install_deps
activate_python_venv
python3 -m pip install -r "$OTNSDIR"/pylibs/unittests/requirements.txt
install_otns
build_openthread_br
Expand All @@ -105,6 +106,7 @@ py_unittests()
py_versions_unittests()
{
install_deps
activate_python_venv
python3 -m pip install -r "$OTNSDIR"/pylibs/unittests/requirements.txt
install_otns
build_openthread_versions
Expand All @@ -126,6 +128,7 @@ check_py_example()
py_examples()
{
install_deps
activate_python_venv
install_otns
build_openthread_br
build_openthread
Expand All @@ -145,6 +148,7 @@ py_examples()
stress_tests()
{
install_deps
activate_python_venv
install_otns
build_openthread_br
build_openthread
Expand Down

0 comments on commit 9b1e405

Please sign in to comment.