-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
119 lines (90 loc) · 2.01 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.EXPORT_ALL_VARIABLES:
COMPOSE_FILE ?= docker/docker-compose-local.yml
COMPOSE_PROJECT_NAME ?= eventsourcing_sqlalchemy
POETRY_VERSION = 1.6.1
POETRY ?= poetry
DOTENV_BASE_FILE ?= .env-base
DOTENV_LOCAL_FILE ?= .env
POETRY_INSTALLER_URL ?= https://install.python-poetry.org
-include $(DOTENV_BASE_FILE)
-include $(DOTENV_LOCAL_FILE)
.PHONY: install-poetry
install-poetry:
curl -sSL $(POETRY_INSTALLER_URL) | python3
$(POETRY) --version
.PHONY: install-packages
install-packages:
$(POETRY) install -vv $(opts)
.PHONY: install-pre-commit-hooks
install-pre-commit-hooks:
ifeq ($(opts),)
$(POETRY) run pre-commit install
endif
.PHONY: uninstall-pre-commit-hooks
uninstall-pre-commit-hooks:
ifeq ($(opts),)
$(POETRY) run pre-commit uninstall
endif
.PHONY: lock-packages
lock-packages:
$(POETRY) lock -vv --no-update
.PHONY: update-packages
update-packages:
$(POETRY) update -vv
.PHONY: docker-up
docker-up:
docker-compose up -d
docker-compose ps
.PHONY: docker-down
docker-down:
docker-compose stop
.PHONY: docker-logs
docker-logs:
docker-compose logs --follow
.PHONY: docker-ps
docker-ps:
docker-compose ps
# Todo: Migrations for SQLAlchemy.
#.PHONY: migrate
#migrate:
# $(POETRY) run django-admin migrate
#
#.PHONY: migrations
#migrations:
# $(POETRY) run django-admin makemigrations
.PHONY: lint-bandit
lint-bandit:
$(POETRY) run bandit --ini .bandit --recursive
.PHONY: lint-black
lint-black:
$(POETRY) run black --check --diff .
.PHONY: lint-flake8
lint-flake8:
$(POETRY) run flake8
.PHONY: lint-isort
lint-isort:
$(POETRY) run isort --check-only --diff .
.PHONY: lint-mypy
lint-mypy:
$(POETRY) run mypy
.PHONY: lint-python
lint-python: lint-black lint-flake8 lint-isort lint-mypy
.PHONY: lint
lint: lint-python
.PHONY: fmt-black
fmt-black:
$(POETRY) run black .
.PHONY: fmt-isort
fmt-isort:
$(POETRY) run isort .
.PHONY: fmt
fmt: fmt-black fmt-isort
.PHONY: test
test:
$(POETRY) run python -m pytest $(opts) $(call tests,.)
.PHONY: build
build:
$(POETRY) build
.PHONY: publish
publish:
$(POETRY) publish