Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python virtual environment #3305

Merged
merged 6 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[install] install venv.
  • Loading branch information
Fabien-B authored and Fabien-B committed Oct 14, 2024
commit 79a64c3272b1709def30dd5f9ce0858bb04fac6f
48 changes: 47 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
#!/bin/bash

sudo apt-get install -f -y python3 python3-pyqt5
USE_VENV=true
BASHRC_SOURCE_VENV=false

# exit on error
set -e

for arg in "$@"
do
if [ "$arg" = "-h" ] || [ "$arg" = "--help" ]
then
echo "Usage: ./install.sh [-n|--no-venv] [-h|---help]"
echo " -n, --no-venv Do not use python virtual environment"
echo " -s, --source Add venv source in ~/.bashrc"
echo " -h, --help Print this help"
exit 0
fi

if [ "$arg" = "-n" ] || [ "$arg" = "--no-venv" ]
then
USE_VENV=false
echo "the venv will not be installed!"
fi

if [ "$arg" = "-s" ] || [ "$arg" = "--source" ]
then
BASHRC_SOURCE_VENV=true
"venv source will be added to ~/.bashrc"
fi

done


if [ "$USE_VENV" = true ]
then
sudo apt install -y python3 python3-venv
python3 setup.py
source pprzEnv/bin/activate

if [ "$BASHRC_SOURCE_VENV" = true ]
then
echo "source $(pwd)/pprzEnv/bin/activate" >> ~/.bashrc
fi

else
sudo apt-get install -f -y python3 python3-pyqt5
fi

python3 ./sw/tools/install.py