From 0961600b471da283d8d553a943a5168742fddd29 Mon Sep 17 00:00:00 2001 From: Dustin Kaiser Date: Thu, 28 Nov 2024 15:22:12 +0100 Subject: [PATCH] Fix j2, double venv --- Makefile | 11 +---------- scripts/common.Makefile | 9 ++++----- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 91228f23..2e80bf48 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ certificates/domain.key: # Done: Creating docker secrets .PHONY: up-local -up-local: .install-fqdn certificates/domain.crt certificates/domain.key .create-secrets ## deploy osparc ops stacks and simcore, use minio_disabled=1 if minio s3 should not be started (if you have custom S3 set up) +up-local: .init .venv .install-fqdn certificates/domain.crt certificates/domain.key .create-secrets ## deploy osparc ops stacks and simcore, use minio_disabled=1 if minio s3 should not be started (if you have custom S3 set up) @bash scripts/deployments/deploy_everything_locally.bash --stack_target=local --minio_enabled=0 --vcs_check=1 @$(MAKE) info-local @@ -71,15 +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 info: ## Displays some important info diff --git a/scripts/common.Makefile b/scripts/common.Makefile index 8e706fc6..7204a256 100644 --- a/scripts/common.Makefile +++ b/scripts/common.Makefile @@ -7,14 +7,12 @@ VERSION := $(shell uname -a) # Checks for handling various operating systems ifeq ($(filter Windows_NT,$(OS)),) -IS_WSL := $(if $(findstring microsoft,$(shell uname -a | tr '[:upper:]' '[:lower:]')),WSL,) IS_WSL2 := $(if $(findstring -microsoft-,$(shell uname -a)),WSL2,) IS_OSX := $(filter Darwin,$(shell uname -a)) IS_LINUX:= $(if $(or $(IS_WSL),$(IS_OSX)),,$(filter Linux,$(shell uname -a))) endif IS_WIN := $(strip $(if $(or $(IS_LINUX),$(IS_OSX),$(IS_WSL)),,$(OS))) -$(if $(IS_WIN),$(error Windows is not supported in all recipes. Use WSL2 instead. Follow instructions in README.md),) $(if $(IS_WSL2),,$(if $(IS_WSL),$(error WSL1 is not supported in all recipes. Use WSL2 instead. Follow instructions in README.md),)) # Check that a valid location to a config file is set. @@ -243,20 +241,21 @@ clean-default: .check_clean ## Cleans all outputs # 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] + @.venv/bin/pip3 install jinja2 j2cli[yaml] typer + @echo "To activate the venv, execute 'source .venv/bin/activate'" # https://github.com/kolypto/j2cli?tab=readme-ov-file#customization ifeq ($(shell test -f j2cli_customization.py && echo -n yes),yes) define jinja - .venv/bin/j2 --format=env $(1) .env -o $(2) --customize j2cli_customization.py + $(REPO_BASE_DIR)/.venv/bin/j2 --format=env $(1) .env -o $(2) --customize j2cli_customization.py endef else define jinja - .venv/bin/j2 --format=env $(1) .env -o $(2) + $(REPO_BASE_DIR)/.venv/bin/j2 --format=env $(1) .env -o $(2) endef endif