Skip to content

Commit

Permalink
Make example app works again (#212)
Browse files Browse the repository at this point in the history
* Fix ownership issue during import
* Use pip install instead of pip sync due to complex dependency resolution
* Fix review findings

---------

Co-authored-by: Markus Petke <[email protected]>
  • Loading branch information
kse3hi and MP91 authored Nov 7, 2023
1 parent 1d8f295 commit 710c30a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .vscode/scripts/import-example-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#
# SPDX-License-Identifier: Apache-2.0

set -e

VELOCITAS_EXAMPLES_PATH="$(python -c 'import velocitas_examples; print(velocitas_examples.__path__[0])')"
CHOSEN_EXAMPLE=$@

Expand All @@ -25,12 +27,20 @@ if [[ `git status --porcelain app/` ]]; then
echo "######################## WARNING #########################"
else
rm -rf app/
cp -a $VELOCITAS_EXAMPLES_PATH/$CHOSEN_EXAMPLE/. app/
cp -r $VELOCITAS_EXAMPLES_PATH/$CHOSEN_EXAMPLE/. app/

# Re-compile requirements*.txt (including app and tests one)
pip-compile -r -q ./requirements.in
pip-sync ./requirements.txt ./app/requirements.txt ./app/tests/requirements.txt
# Re-intstall necessary packages in DevContainer
for file in ./requirements.txt ./app/requirements.txt ./app/tests/requirements.txt ./app/requirements-links.txt
do
if [ -f $file ]; then
pip3 install -r $file
fi
done

# Generate model referenced by imported example
velocitas exec vehicle-model-lifecycle download-vspec
velocitas exec vehicle-model-lifecycle generate-model

echo "#######################################################"
Expand Down

0 comments on commit 710c30a

Please sign in to comment.