Skip to content

Commit

Permalink
Create VENV_PATH variable
Browse files Browse the repository at this point in the history
Signed-off-by: Stavros Ntentos <[email protected]>
  • Loading branch information
stdedos committed Dec 20, 2023
1 parent cf107ea commit f26a98d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
export VENV_PATH := .venv
# Use python executables inside venv
export PATH := .venv/bin:$(PATH)
export PATH := $(VENV_PATH)/bin:$(PATH)
export PYTHONPATH=.

# creates the venv
.venv/bin/python3.11:
python3.11 -m venv .venv
$(VENV_PATH)/bin/python3.11:
python3.11 -m venv $(VENV_PATH)

# makes sures the venv contains a given version of pip and pip-tools
.venv: .venv/bin/python3.11
$(VENV_PATH): $(VENV_PATH)/bin/python3.11
pip install --quiet --upgrade 'pip==23.3.1' 'pip-tools==7.3'

# generates a lock file with pinned version of all dependencies to be used by the CI and local devs
requirements/dev.txt: .venv requirements/dev.in pyproject.toml
requirements/dev.txt: $(VENV_PATH) requirements/dev.in pyproject.toml
pip-compile \
--quiet --generate-hashes --max-rounds=20 --strip-extras \
--resolver=backtracking \
--output-file requirements/dev.txt \
requirements/dev.in pyproject.toml

# upgrades the dependencies to their latest/matching version
upgrade: .venv
upgrade: $(VENV_PATH)
pip-compile \
--quiet --generate-hashes --max-rounds=20 --strip-extras \
--upgrade \
Expand All @@ -30,7 +31,7 @@ upgrade: .venv

# creates the venv if not present then install the dependencies, the package and pre-commit
.PHONY: install
install: .venv
install: $(VENV_PATH)
pip-sync requirements/dev.txt
# install pylint_pytest (deps are already handled by the line before)
pip install --no-deps -e .
Expand Down

0 comments on commit f26a98d

Please sign in to comment.