-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
37 lines (27 loc) · 981 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.PHONY: init test clean
PIPX := $(shell command -v pipx --version 2> /dev/null)
POETRY := $(shell command -v poetry 2> /dev/null)
OTTERDOG_SCRIPT := $(realpath ./otterdog.sh)
OTTERDOG_LINK := ~/.local/bin/otterdog
all: help
init: ## Initialize the development environment
ifndef PIPX
$(error "Please install pipx first, e.g. using 'apt install pipx' or 'brew install pipx")
endif
ifndef POETRY
pipx install "poetry>=2.0.1"
endif
poetry config virtualenvs.in-project true
poetry dynamic-versioning show || poetry sync --only-root
poetry sync
poetry run playwright install firefox
test -f $(OTTERDOG_LINK) || ln -s $(OTTERDOG_SCRIPT) $(OTTERDOG_LINK)
test: ## Run tests
poetry run py.test
clean: ## Clean the development environment
rm -rf .venv
rm -rf dist
rm -rf .pytest_cache
git clean -X -d -f
help: ## Show this help
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'