forked from jacebrowning/template-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 1.15 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SOURCE_FILES = Makefile cookiecutter.json {{cookiecutter.project_name}}/* {{cookiecutter.project_name}}/*/*
GENERATED_PROJECT := TemplateDemo
ENV := .venv
# MAIN #########################################################################
.PHONY: all
all: install
.PHONY: ci
ci: build
make doctor -C $(GENERATED_PROJECT)
make install -C $(GENERATED_PROJECT)
make ci -C $(GENERATED_PROJECT)
.PHONY: watch
watch: install clean
poetry run sniffer
# DEPENDENCIES #################################################################
.PHONY: install
install: $(ENV)
$(ENV): pyproject.toml poetry.lock
ifdef CI
poetry install --no-dev
else
poetry install
endif
@ touch $@
# BUILD ########################################################################
.PHONY: build
build: install $(GENERATED_PROJECT)
$(GENERATED_PROJECT): $(SOURCE_FILES)
cat cookiecutter.json
poetry run cookiecutter . --no-input --overwrite-if-exists
cd $(GENERATED_PROJECT) && poetry lock
@ touch $(GENERATED_PROJECT)
# CLEANUP ######################################################################
.PHONY: clean
clean:
rm -rf $(GENERATED_PROJECT)
.PHONY: clean-all
clean-all: clean
rm -rf $(ENV)