From 5a4e98424f2de02506d4e0580142597125dc0cb3 Mon Sep 17 00:00:00 2001 From: Roman Bredehoft Date: Thu, 11 Jan 2024 14:13:15 +0100 Subject: [PATCH] chore: fix poetry version check in sync_env make target --- Makefile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index c7a672ebe..e7a69b6d8 100644 --- a/Makefile +++ b/Makefile @@ -54,13 +54,17 @@ setup_env: "$(MAKE)" fix_omp_issues_for_intel_mac .PHONY: sync_env # Synchronise the environment -sync_env: check_poetry_version - if [[ $$(uname) != "Linux" ]] && [[ $$(uname) != "Darwin" ]]; then \ - poetry install --remove-untracked --only dev; \ +sync_env: + if [[ $$(poetry --version) != "Poetry (version $(POETRY_VERSION))" ]];then \ + echo "Current Poetry version is different than $(POETRY_VERSION). Please update it.";\ else \ - poetry install --remove-untracked; \ + if [[ $$(uname) != "Linux" ]] && [[ $$(uname) != "Darwin" ]]; then \ + poetry install --remove-untracked --only dev; \ + else \ + poetry install --remove-untracked; \ + fi; \ + "$(MAKE)" setup_env; \ fi - "$(MAKE)" setup_env .PHONY: fix_omp_issues_for_intel_mac # Fix OMP issues for macOS Intel, https://github.com/zama-ai/concrete-ml-internal/issues/3951 fix_omp_issues_for_intel_mac: @@ -90,15 +94,6 @@ reinstall_env: echo "source $${SOURCE_VENV_PATH}"; \ fi -.PHONY: check_poetry_version # Check poetry's version -check_poetry_version: - if [[ $$(poetry --version) == "Poetry (version $(POETRY_VERSION))" ]];then \ - echo "Poetry version is ok";\ - else\ - echo "Expected poetry version is not the expected one: $(POETRY_VERSION)"\ - exit 1;\ - fi - .PHONY: python_format # Apply python formatting python_format: poetry run env bash ./script/source_format/format_python.sh \