-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
Makefile
212 lines (167 loc) · 4.5 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.EXPORT_ALL_VARIABLES:
DOTENV_FILE ?= dev/.env
-include $(DOTENV_FILE)
POETRY ?= poetry
POETRY_VERSION=1.8.3
POETRY_INSTALLER_URL ?= https://install.python-poetry.org
PYTHONUNBUFFERED=1
SAMPLES_LINE_LENGTH=70
.PHONY: install-poetry
install-poetry:
curl -sSL $(POETRY_INSTALLER_URL) | python3
$(POETRY) --version
.PHONY: install
install:
$(POETRY) install --sync --extras "crypto" --with "docs" -vv $(opts)
.PHONY: install-packages
install-packages:
$(POETRY) install --sync --no-root --extras "crypto" --with "docs" -vv $(opts)
.PHONY: update-lockfile
update-lockfile:
$(POETRY) lock --no-update
.PHONY: update-packages
update-packages: update-lockfile install-packages
.PHONY: lint
lint: lint-black lint-ruff lint-isort lint-mypy #lint-dockerfile
.PHONY: lint-black
lint-black:
$(POETRY) run black --check --diff eventsourcing tests examples
.PHONY: lint-ruff
lint-ruff:
$(POETRY) run ruff check eventsourcing tests examples
# .PHONY: lint-flake8
# lint-flake8:
# $(POETRY) run flake8 eventsourcing
.PHONY: lint-isort
lint-isort:
$(POETRY) run isort --check-only --diff eventsourcing tests examples
.PHONY: lint-mypy
lint-mypy:
$(POETRY) run mypy eventsourcing tests examples
# .PHONY: lint-dockerfile
# lint-dockerfile:
# @docker run --rm -i replicated/dockerfilelint:ad65813 < ./dev/Dockerfile_eventsourcing_requirements
#
.PHONY: fmt
fmt: fmt-isort fmt-black fmt-ruff
.PHONY: fmt-ruff
fmt-ruff:
$(POETRY) run ruff --fix eventsourcing tests examples
.PHONY: fmt-ruff-unsafe
fmt-ruff-unsafe:
$(POETRY) run ruff --fix --unsafe-fixes eventsourcing
.PHONY: fmt-black
fmt-black:
$(POETRY) run black eventsourcing tests examples
.PHONY: fmt-isort
fmt-isort:
$(POETRY) run isort eventsourcing tests examples
.PHONY: test
test: coveragetest coverage100 timeit
.PHONY: coveragetest
coveragetest:
$(POETRY) run coverage run -m unittest discover . -v
.PHONY: coverage100
coverage100:
$(POETRY) run coverage report --fail-under=100 --show-missing
.PHONY: unittest
unittest:
$(POETRY) run python -m unittest discover . -v
.PHONY: timeit
timeit: timeit_popo timeit_sqlite timeit_postgres
.PHONY: timeit_popo
timeit_popo:
TEST_TIMEIT_FACTOR=500 $(POETRY) run python -m unittest tests.application_tests.test_application_with_popo
.PHONY: timeit_sqlite
timeit_sqlite:
TEST_TIMEIT_FACTOR=500 $(POETRY) run python -m unittest tests.application_tests.test_application_with_sqlite
.PHONY: timeit_postgres
timeit_postgres:
TEST_TIMEIT_FACTOR=500 $(POETRY) run python -m unittest tests.application_tests.test_application_with_postgres
.PHONY: build
build:
$(POETRY) build
# $(POETRY) build -f sdist # build source distribution only
.PHONY: publish
publish:
$(POETRY) publish
.PHONY: docker-pull
docker-pull:
@docker-compose pull
.PHONY: docker-build
docker-build:
@docker-compose build
.PHONY: docker-up
docker-up:
@docker-compose up -d
@docker-compose ps
.PHONY: docker-stop
docker-stop:
@docker-compose stop
.PHONY: docker-down
docker-down:
@docker-compose down -v --remove-orphans
.PHONY: docker-logs
docker-logs:
@docker-compose logs --follow --tail=1000
#
#
# .PHONY: coverage
# coverage: coveragetest coveragehtml coverage100
#
# .PHONY: prepush
# prepush: drop_postgres_db create_postgres_db updatetools lint docs test
#
# .PHONY: drop_postgres_db
# drop_postgres_db:
# dropdb eventsourcing
#
# .PHONY: create_postgres_db
# create_postgres_db:
# createdb eventsourcing
# psql eventsourcing -c "CREATE SCHEMA myschema AUTHORIZATION eventsourcing"
#
# .PHONY: updatetools
# updatetools:
# pip install -U pip
# pip install -U black mypy flake8 flake8-bugbear isort python-coveralls coverage orjson pydantic
#
.PHONY: docs
docs:
cd docs && make html
#
# .PHONY: brew-services-start
# brew-services-start:
# # brew services start mysql
# brew services start postgresql
# # brew services start redis
# # ~/axonserver/axonserver.jar &
# # cassandra -f &
#
#
# .PHONY: brew-services-stop
# brew-services-stop:
# # brew services stop mysql || echo "Mysql couldn't be stopped"
# brew services stop postgresql || echo "PostgreSQL couldn't be stopped"
# # brew services stop redis || echo "Redis couldn't be stopped"
# # pkill -15 java
#
#
# .PHONY: prepare-dist
# prepare-dist:
# python ./dev/prepare-distribution.py
#
#
# .PHONY: release-dist
# release-dist:
# python ./dev/release-distribution.py
#
#
# .PHONY: test-released-distribution
# test-released-distribution:
# python ./dev/test-released-distribution.py
#
#
# .PHONY: ramdisk
# ramdisk:
# diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://204800`