Skip to content

Commit

Permalink
update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
grigaut committed Jul 7, 2023
1 parent f2c9d07 commit 5fe753f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions {{cookiecutter.package_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ CURRENT_ENV :=
DEFAULT_ENV := .venv
HOOKS = .git/hooks

ifdef $(shell command -v poetry env info --path 2> /dev/null)
VIRTUAL_ENV = poetry env info --path

CURRENT_ENV := $(shell command -v poetry env info --path 2> /dev/null)

ifdef CURRENT_ENV
VIRTUAL_ENV = ${GLOBAL_POETRY} env info --path
else
VIRTUAL_VENV = DEFAULT_ENV
endif
Expand All @@ -26,7 +29,7 @@ clean:

# Poetry Tatgets

check-poetry:
check-poetry: pyproject.toml
@if [ -z ${GLOBAL_POETRY} ]; then echo "Poetry is not installed on your global python. Use 'make install-poetry' to install Poetry on your global python."; exit 2 ;fi
${GLOBAL_POETRY} lock --no-update

Expand All @@ -37,7 +40,7 @@ ${VIRTUAL_ENV}:
${PYTHON} -m venv ${VIRTUAL_ENV}

.PHONY: poetry-install
poetry-install: pyproject.toml
poetry-install:
${MAKE} -s check-poetry
${GLOBAL_POETRY} install --only main --ansi

Expand All @@ -49,7 +52,7 @@ install:
# Development Rules

.PHONY: poetry-install-dev
poetry-install-dev: pyproject.toml poetry.lock
poetry-install-dev:
${MAKE} -s check-poetry
${GLOBAL_POETRY} install --ansi

Expand All @@ -71,7 +74,7 @@ tests:
# Documentation Rules

.PHONY: poetry-install-docs
poetry-install-docs: poetry.lock
poetry-install-docs:
${MAKE} -s check-poetry
${GLOBAL_POETRY} install --only docs --ansi

Expand Down

0 comments on commit 5fe753f

Please sign in to comment.