diff --git a/Makefile b/Makefile index ef27c8ab..13fd07bc 100644 --- a/Makefile +++ b/Makefile @@ -71,13 +71,6 @@ down-maintenance: ## Stop the maintenance mode fi \ ,) -.PHONY: venv -venv: .venv ## Creates a python virtual environment with dev tools (pip, pylint, ...) -.venv: - @python3 -m venv .venv - @.venv/bin/pip3 install --upgrade pip wheel setuptools - @.venv/bin/pip3 install typer - @echo "To activate the venv, execute 'source .venv/bin/activate'" # Misc: info & clean .PHONY: info info-vars info-local diff --git a/scripts/common.Makefile b/scripts/common.Makefile index c54be7cf..d2022001 100644 --- a/scripts/common.Makefile +++ b/scripts/common.Makefile @@ -221,13 +221,17 @@ clean-default: .check_clean ## Cleans all outputs fi # Helpers ------------------------------------------------- -.venv: +# Replace the existing .venv target with the following +$(REPO_BASE_DIR)/.venv/bin/activate: # creating virtual environment with tooling (jinja, etc) - @python3 -m venv .venv - @.venv/bin/pip3 install --upgrade pip wheel setuptools - @.venv/bin/pip3 install jinja2 j2cli[yaml] typer - @echo "To activate the venv, execute 'source .venv/bin/activate'" - + python3 -m venv $(REPO_BASE_DIR)/.venv + $(REPO_BASE_DIR)/.venv/bin/pip3 install --upgrade pip wheel setuptools + $(REPO_BASE_DIR)/.venv/bin/pip3 install jinja2 j2cli[yaml] typer + @echo "To activate the venv, execute 'source $(REPO_BASE_DIR)/.venv/bin/activate'" +PHONY: .venv +.venv: $(REPO_BASE_DIR)/.venv/bin/activate ## Creates a python virtual environment with dev tools (pip, pylint, ...) +.PHONY: venv +venv: $(REPO_BASE_DIR)/.venv/bin/activate ## Creates a python virtual environment with dev tools (pip, pylint, ...) # https://github.com/kolypto/j2cli?tab=readme-ov-file#customization ifeq ($(shell test -f j2cli_customization.py && echo -n yes),yes)