1+ export VENV_PATH := .venv
12# Use python executables inside venv
2- export PATH := .venv /bin:$(PATH )
3+ export PATH := $( VENV_PATH ) /bin:$(PATH )
34export PYTHONPATH =.
45
56# creates the venv
6- .venv /bin/python3.11 :
7- python3.11 -m venv .venv
7+ $( VENV_PATH ) /bin/python3.11 :
8+ python3.11 -m venv $( VENV_PATH )
89
910# makes sures the venv contains a given version of pip and pip-tools
10- .venv : .venv /bin/python3.11
11+ $( VENV_PATH ) : $( VENV_PATH ) /bin/python3.11
1112 pip install --quiet --upgrade ' pip==23.3.1' ' pip-tools==7.3'
1213
1314# generates a lock file with pinned version of all dependencies to be used by the CI and local devs
14- requirements/dev.txt : .venv requirements/dev.in pyproject.toml
15+ requirements/dev.txt : $( VENV_PATH ) requirements/dev.in pyproject.toml
1516 pip-compile \
1617 --quiet --generate-hashes --max-rounds=20 --strip-extras \
1718 --resolver=backtracking \
1819 --output-file requirements/dev.txt \
1920 requirements/dev.in pyproject.toml
2021
2122# upgrades the dependencies to their latest/matching version
22- upgrade : .venv
23+ upgrade : $( VENV_PATH )
2324 pip-compile \
2425 --quiet --generate-hashes --max-rounds=20 --strip-extras \
2526 --upgrade \
@@ -30,7 +31,7 @@ upgrade: .venv
3031
3132# creates the venv if not present then install the dependencies, the package and pre-commit
3233.PHONY : install
33- install : .venv
34+ install : $( VENV_PATH )
3435 pip-sync requirements/dev.txt
3536 # install pylint_pytest (deps are already handled by the line before)
3637 pip install --no-deps -e .
0 commit comments