Skip to content

Commit

Permalink
Fix j2, double venv
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnicegyu11 committed Nov 28, 2024
1 parent 65907fc commit 0961600
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions scripts/common.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0961600

Please sign in to comment.