-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (57 loc) · 1.86 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
include vars.mk
.DEFAULT_GOAL := all
.PHONY: clean default dev ensure-uv fmt lint test help shiny ex-api ex-starwars client server
all: dev lint
client:
$(UV) run python app.py
server:
$(UV) run python -m src.openapi_mcp.connect_api
clean:
rm -rf .pytest_cache .ruff_cache *.egg-info
find . -name "*.egg-info" -exec rm -rf {} +
find . -name "*.pyc" -exec rm -f {} +
find . -name "__pycache__" -exec rm -rf {} +
find . -type d -empty -delete
dev: ensure-uv
$(UV) pip install -e .
$(VIRTUAL_ENV):
$(UV) venv $(VIRTUAL_ENV)
ensure-uv:
@if ! command -v $(UV) >/dev/null; then \
$(PYTHON) -m ensurepip && $(PYTHON) -m pip install "uv >= 0.4.27"; \
fi
@# Install virtual environment (before calling `uv pip install ...`)
@$(MAKE) $(VIRTUAL_ENV) 1>/dev/null
@# Be sure recent uv is installed
@$(UV) pip install "uv >= 0.4.27" --quiet
fmt: dev
$(UV) run ruff check --fix
$(UV) run ruff format
$(UV_LOCK): dev
$(UV) lock
lint: dev
$(UV) run ruff check
$(UV) run pyright
test: dev
echo "Not implemented yet"
exit 1
$(UV) run --source=src -m pytest tests
ex-api: # dev
$(UV) run --group ex-fastapi uvicorn ex_api.main:app --reload
ex-starwars: # dev
$(UV) run --group ex-fastapi uvicorn ex_starwars.main:app --reload
shiny: # dev
$(UV) run --group ex-fastapi python -m shiny run --port 56025 --reload --autoreload-port 56026 shiny/app.py
help:
@echo "Makefile Targets"
@echo " all Run dev and lint"
@echo " clean Clean up project artifacts"
@echo " dev Install the project in editable mode"
@echo " ensure-uv Ensure 'uv' is installed"
@echo " fmt Format the code"
@echo " lint Lint the code"
@echo " test Run unit tests"
_barret_deploy_api:
cd ex_starwars && rsconnect deploy fastapi . -v
_barret_deploy_shiny:
cd shiny && CONNECT_SERVER="$$POSIT_CONNECT_SERVER" rsconnect deploy shiny . -v