-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.23 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
.PHONY: all format lint test help
# Default target executed when no arguments are given to make.
all: help
start:
poetry run uvicorn langserve_launch_example.server:app --reload
# Define a variable for the test file path.
TEST_FILE ?= tests/
test:
poetry run pytest $(TEST_FILE)
# Define a variable for Python and notebook files.
PYTHON_FILES=.
lint format: PYTHON_FILES=.
lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d main | grep -E '\.py$$|\.ipynb$$')
lint lint_diff:
poetry run mypy $(PYTHON_FILES)
poetry run black $(PYTHON_FILES) --check
poetry run ruff .
format format_diff:
poetry run black $(PYTHON_FILES)
poetry run ruff --select I --fix $(PYTHON_FILES)
deploy_gcp:
gcloud run deploy langserve-launch-example --source . --port 8001 --env-vars-file .env.gcp.yaml --allow-unauthenticated --region us-central1 --min-instances 1
######################
# HELP
######################
help:
@echo '----'
@echo 'make start - start server'
@echo 'make format - run code formatters'
@echo 'make lint - run linters'
@echo 'make test - run unit tests'
@echo 'make deploy_gcp - deploy to GCP'