Skip to content

Commit a9b0147

Browse files
neo-0007amilcarlucas
authored andcommitted
fix(setup): create & activate venv before installing dependencies in setupDeveloperPC.sh
Previously, setupDeveloperPC.sh for Linux/MacOS tried to install python packages even if no virtual environment is active It was causing to skip installation of packages leading to dependency issues This commit - checks if venv exists , if not than it creates it and activates it - added .venv/ to gitignore to stop tracking it Signed-off-by: neo-0007 <hrishikeshgohain123@gmail.com>
1 parent e3d047b commit a9b0147

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ git_hash.txt
1111

1212
/.coverage
1313
venv/
14+
.venv/
1415
test.txt
1516
test.xml

SetupDeveloperPC.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ ORIGINAL_DIR=$(pwd)
2121
# Change to the directory where the script resides
2222
cd "$(dirname "$0")" || exit
2323

24+
# Create a local virtual environment if it doesn't exist
25+
if [ ! -d ".venv" ]; then
26+
echo "Creating Python virtual environment..."
27+
python3 -m venv .venv
28+
fi
29+
30+
# Activate the virtual environment
31+
echo "Activating virtual environment..."
32+
# shellcheck disable=SC1091
33+
source .venv/bin/activate
34+
2435
InstallDependencies() {
2536
echo "Updating package lists..."
2637
if command -v apt-get &> /dev/null; then

0 commit comments

Comments
 (0)