-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvenv.sh
38 lines (35 loc) · 1.18 KB
/
venv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if [[ -d "./.venv" ]]; then
echo "Updating package install..."
if [[ -e "./.venv/Scripts/activate" ]]; then
source ./.venv/Scripts/activate
elif [[ -e "./.venv/bin/activate" ]]; then
source ./.venv/bin/activate
else
echo "Cannot find activation script"
exit 2
fi
echo "Updating project dependencies to latest constraint levels defined in 'pyproject.toml'"
poetry update
echo "Listing all outdated dependencies regardless of constraint level"
poetry show -o
else
echo "Installing tool dependencies..."
pip install tox poetry
echo "Creating virtual environment..."
python -m venv --upgrade-deps ./.venv
if [[ -e "./.venv/Scripts/activate" ]]; then
source ./.venv/Scripts/activate
elif [[ -e "./.venv/bin/activate" ]]; then
source ./.venv/bin/activate
else
echo "Cannot find activation script"
exit 2
fi
echo "Python being used at $(which python)"
echo "Upgrading pip"
python -m pip install --upgrade pip
echo "Installing project dependencies..."
poetry install
echo "Listing all outdated dependencies regardless of constraint level"
poetry show -o
fi