-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (40 loc) · 1.53 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
PORT ?= 5001
IMAGE_NAME ?= ai-dial-interceptors-sdk
PLATFORM ?= linux/amd64
ARGS=
.PHONY: all install build clean lint format test examples_serve examples_docker_serve
all: build
install:
poetry install --all-extras
poetry run codegen
build: install
poetry build
clean:
poetry run clean
poetry env remove --all
publish: build
poetry publish -u __token__ -p ${PYPI_TOKEN} --skip-existing
lint: install
poetry run nox -s lint
format: install
poetry run nox -s format
test: install
poetry run nox -s test $(if $(PYTHON),--python=$(PYTHON),)
examples_serve: install
poetry run uvicorn "aidial_interceptors_sdk.examples.app:app" --reload --host "0.0.0.0" --port $(PORT) --workers=1 --env-file ./.env
examples_docker_serve:
docker build --platform $(PLATFORM) -t $(IMAGE_NAME):dev .
docker run --platform $(PLATFORM) --env-file ./.env --rm -p $(PORT):5000 $(IMAGE_NAME):dev
help:
@echo '===================='
@echo 'build - build the source and wheels archives'
@echo 'clean - clean virtual env and build artifacts'
@echo 'publish - publish the library to PyPi'
@echo '-- LINTING --'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo '-- RUNNING EXAMPLES --'
@echo 'examples_serve - run the dev server with examples locally'
@echo 'examples_docker_serve - run the dev server with examples from the docker'
@echo '-- TESTS --'
@echo 'test - run unit tests'