From f26a98d42ce40560da0c4317392d195c47b73af2 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:37:25 +0200 Subject: [PATCH] Create `VENV_PATH` variable Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c4454e9..2d0e91d 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,18 @@ +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 \ @@ -19,7 +20,7 @@ requirements/dev.txt: .venv requirements/dev.in pyproject.toml 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 \ @@ -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 .