forked from pyeventsourcing/eventsourcing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
199 lines (148 loc) · 4.47 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
.EXPORT_ALL_VARIABLES:
DOTENV_FILE ?= dev/.env
-include $(DOTENV_FILE)
.PHONY: install
install:
@pip install -U pip
@pip install wheel
@pip install -U -e ".[dev]"
.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: lint-black
lint-black:
@black --check --diff eventsourcing
@black --check --diff setup.py
.PHONY: lint-flake8
lint-flake8:
@flake8 eventsourcing
.PHONY: lint-isort
lint-isort:
@isort --check-only --diff eventsourcing
.PHONY: lint-mypy
lint-mypy:
@mypy eventsourcing
.PHONY: lint-dockerfile
lint-dockerfile:
@docker run --rm -i replicated/dockerfilelint:ad65813 < ./dev/Dockerfile_eventsourcing_requirements
.PHONY: lint
lint: lint-isort lint-black lint-flake8 lint-mypy #lint-dockerfile
.PHONY: fmt-isort
fmt-isort:
@isort eventsourcing
.PHONY: fmt-black
fmt-black:
@black eventsourcing
@black setup.py
.PHONY: fmt
fmt: fmt-isort fmt-black
.PHONY: unittest
unittest:
@python -m unittest discover . -v
.PHONY: timeit
timeit: timeit_popo timeit_sqlite timeit_postgres
.PHONY: timeit_popo
timeit_popo:
TEST_TIMEIT_FACTOR=500 python -m unittest eventsourcing.tests.application_tests.test_application_with_popo
.PHONY: timeit_sqlite
timeit_sqlite:
TEST_TIMEIT_FACTOR=500 python -m unittest eventsourcing.tests.application_tests.test_application_with_sqlite
.PHONY: timeit_postgres
timeit_postgres:
TEST_TIMEIT_FACTOR=500 python -m unittest eventsourcing.tests.application_tests.test_application_with_postgres
.PHONY: rate
rate: rate_popo rate_sqlite rate_postgres
.PHONY: rate_popo
rate_popo:
python -m unittest eventsourcing.tests.persistence_tests.test_popo.TestPOPOApplicationRecorder.test_concurrent_throughput
.PHONY: rate_sqlite
rate_sqlite:
python -m unittest eventsourcing.tests.persistence_tests.test_sqlite.TestSQLiteApplicationRecorder.test_concurrent_throughput
python -m unittest eventsourcing.tests.persistence_tests.test_sqlite.TestSQLiteApplicationRecorder.test_concurrent_throughput_in_memory_db
.PHONY: rate_postgres
rate_postgres:
python -m unittest eventsourcing.tests.persistence_tests.test_postgres.TestPostgresApplicationRecorder.test_concurrent_throughput
.PHONY: coveragetest
coveragetest:
@coverage run -m unittest discover . -v
# @coverage run \
# --concurrency=multiprocessing \
# -m unittest discover \
eventsourcing -vv --failfast
# @coverage combine
# @coverage report
# @coverage html
.PHONY: coverage100
coverage100:
@coverage report --fail-under=100 --show-missing
.PHONY: coveragehtml
coveragehtml:
@coverage html
.PHONY: test
test: coveragetest coverage100 timeit
.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: generate-grpc-protos
#generate-grpc-protos:
# python -m grpc_tools.protoc \
# --proto_path=./eventsourcing/system/grpc \
# --python_out=eventsourcing/system/grpc \
# --grpc_python_out=eventsourcing/system/grpc \
# eventsourcing/system/grpc/processor.proto
.PHONY: ramdisk
ramdisk:
diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://204800`