@@ -27,12 +27,13 @@ PYENV_VERSION_DIR ?= $(shell pyenv root)/versions/$(shell head -n 1 $(PYTHON_VER
2727# use just the first
2828PYTHON_EXEC ?= $(shell pyenv prefix | cut -d: -f1) /bin/python3
2929endif
30- ifeq ("$(shell which poetry) ","")
31- # poetry is installed
32- POETRY_TASK =
33- else
30+ POETRY_PATH = $(shell command -v poetry)
31+ ifeq ("$(POETRY_PATH ) ","")
3432# poetry is not installed
3533POETRY_TASK = install-poetry
34+ else
35+ # poetry is installed
36+ POETRY_TASK =
3637endif
3738
3839# If we're on macos arm64, we might to need to build some packages,
@@ -83,6 +84,11 @@ PYTEST ?= $(POETRY) run pytest
8384help : # # Display this help
8485 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
8586
87+ .PHONY : debug-make
88+ debug-make : # # Shows ~all runtime-set variables
89+ @echo $(foreach v, $(.VARIABLES ) , $(info $(v ) = $($(v ) ) ) )
90+
91+
8692# #@ Development
8793
8894.PHONY : test
@@ -181,6 +187,11 @@ python-current: ## Display the version and binary location of python3
181187 @$(CURRENT_PYTHON ) --version
182188 @echo PYTHON_EXEC = $(PYTHON_EXEC )
183189
190+ .PHONY : install-poetry
191+ install-poetry : # # Installs Poetry to the current Python environment
192+ @echo " $( COLOR_ORANGE) Installing Poetry from python-poetry.org with $( CURRENT_PYTHON) $( COLOR_RESET) "
193+ curl -sSL https://install.python-poetry.org | $(CURRENT_PYTHON ) -
194+
184195.PHONY : deps
185196deps : deps-brew deps-py $(DEPS_TASKS_IF_PERU_CONFIG ) install-precommit # # Installs all dependencies
186197 @echo " $( COLOR_GREEN) All deps installed!$( COLOR_RESET) "
@@ -222,11 +233,6 @@ deps-peru: $(PERU_CONFIG) ## Installs dependencies from Peru
222233deps-ci : $(DEPS_TASKS_IF_PERU_CONFIG ) poetry-install # # Install CI check and test dependencies (assumes Python & Poetry already present in env)
223234 @echo " $( COLOR_GREEN) All CI dependencies installed!$( COLOR_RESET) "
224235
225- .PHONY : install-poetry
226- install-poetry : # # Installs Poetry to the current Python environment
227- @echo " $( COLOR_ORANGE) Installing Poetry from python-poetry.org with $( CURRENT_PYTHON) $( COLOR_RESET) "
228- curl -sSL https://install.python-poetry.org | $(CURRENT_PYTHON ) -
229-
230236.PHONY : install-python
231237install-python : $(PYTHON_EXEC ) # # Installs appropriate Python version
232238 @echo " $( COLOR_GREEN) Python installed to $( PYTHON_EXEC) $( COLOR_RESET) "
0 commit comments