-
Notifications
You must be signed in to change notification settings - Fork 121
/
Makefile
78 lines (64 loc) · 2.07 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
# Load environment variables from .env file
include .env
.PHONY: tests tests-basic lint install mypy update ui-install ui-run docker
# Existing commands
tests:
poetry run pytest
tests-basic:
poetry run pytest tests/basic
poetry run pytest tests/test_api.py
poetry run pytest tests/test_runner_caching.py
lint:
poetry run ruff check docetl/* --fix
install:
pip install poetry
poetry install --all-extras
mypy:
poetry run mypy
update:
poetry update
# UI-related commands
UI_DIR := ./website
install-ui:
cd $(UI_DIR) && npm install
run-ui-dev:
@echo "Starting server..."
@python server/app/main.py & \
echo "Starting UI development server..." && \
cd $(UI_DIR) && HOST=${FRONTEND_HOST} PORT=${FRONTEND_PORT} npm run dev
run-ui:
@echo "Starting server..."
@python server/app/main.py & \
echo "Building UI..." && \
cd $(UI_DIR) && npm run build && HOST=${FRONTEND_HOST} PORT=${FRONTEND_PORT} NEXT_PUBLIC_FRONTEND_ALLOWED_HOSTS=${FRONTEND_ALLOWED_HOSTS} npm run start
# Single Docker command to build and run
docker:
docker volume create docetl-data && \
docker build -t docetl . && \
docker run --rm -it \
-p 3000:3000 \
-p 8000:8000 \
-v docetl-data:/docetl-data \
-e FRONTEND_HOST=0.0.0.0 \
-e FRONTEND_PORT=3000 \
-e BACKEND_HOST=0.0.0.0 \
-e BACKEND_PORT=8000 \
docetl
# Add new command for cleaning up docker resources
docker-clean:
docker volume rm docetl-data
# Help command
help:
@echo "Available commands:"
@echo " make tests : Run all tests"
@echo " make tests-basic : Run basic tests"
@echo " make lint : Run linter"
@echo " make install : Install dependencies using Poetry"
@echo " make mypy : Run mypy for type checking"
@echo " make update : Update dependencies"
@echo " make install-ui : Install UI dependencies"
@echo " make run-ui-dev : Run UI development server"
@echo " make run-ui : Run UI production server"
@echo " make docker : Build and run docetl in Docker"
@echo " make docker-clean : Remove docetl Docker volume"
@echo " make help : Show this help message"