-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
71 lines (45 loc) · 1.52 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
PORT = 5001
IMAGE_NAME = ai-dial-analytics-realtime
ARGS =
.PHONY: all build serve docker_build docker_serve lint format test test_all docs clean help
all: build
build:
poetry build
serve:
poetry install --only main
poetry run uvicorn aidial_analytics_realtime.app:app --port=$(PORT) --env-file .env
docker_build:
docker build --platform linux/amd64 -t $(IMAGE_NAME):dev .
docker_serve: docker_build
docker run --platform linux/amd64 --env-file ./.env --rm -p $(PORT):5000 $(IMAGE_NAME):dev
lint:
poetry install --only nox
poetry run nox -s lint
format:
poetry install --only nox
poetry run nox -s format
test:
poetry install --only nox
poetry run -- nox -s tests -- -m "not with_external" $(ARGS)
test_all:
poetry install --only nox
poetry run -- nox -s tests -- $(ARGS)
docs:
# Do nothing
clean:
@rm -rf .venv
@rm -rf .nox
@find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
help:
@echo '===================='
@echo 'build - build the source and wheels archives'
@echo 'docker_build - build the docker image'
@echo 'clean - clean virtual env and build artifacts'
@echo '-- LINTING --'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo '-- RUN --'
@echo 'serve - run the server locally'
@echo 'docker_serve - run the server using docker'
@echo '-- TESTS --'
@echo 'test - run unit tests'