-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathMakefile
More file actions
140 lines (117 loc) · 4.03 KB
/
Makefile
File metadata and controls
140 lines (117 loc) · 4.03 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.PHONY: install
install: ## Install the uv environment and all packages with dependencies
@echo "🚀 Creating virtual environment and installing all packages using uv workspace"
@uv sync --extra all --extra dev
@uv run pre-commit install
@echo "✅ All packages and dependencies installed via uv workspace"
.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Linting code: Running pre-commit"
@uv run pre-commit run -a
@echo "🚀 Static type checking: Running mypy on libs"
@for lib in libs/arcade*/ ; do \
echo "🔍 Type checking $$lib"; \
(cd $$lib && uv run mypy . --exclude tests || true); \
done
.PHONY: check-libs
check-libs: ## Run code quality tools for each lib package
@echo "🚀 Running checks on each lib package"
@for lib in libs/arcade*/ ; do \
echo "🛠️ Checking lib $$lib"; \
(cd $$lib && uv run pre-commit run -a || true); \
(cd $$lib && uv run mypy . || true); \
done
.PHONY: test
test: install ## Test the code with pytest
@echo "🚀 Testing libs: Running pytest"
@uv run pytest -W ignore -v libs/tests --cov=libs --cov-config=pyproject.toml --cov-report=xml
.PHONY: test-libs
test-libs: ## Test each lib package individually
@echo "🚀 Testing each lib package"
@for lib in libs/arcade*/ ; do \
echo "🧪 Testing $$lib"; \
(cd $$lib && uv run pytest -W ignore -v || true); \
done
.PHONY: coverage
coverage: ## Generate coverage report
@echo "coverage report"
@uv run coverage report
@echo "Generating coverage report"
@uv run coverage html
.PHONY: build
build: clean-build ## Build wheel files using uv
@echo "🚀 Creating wheel files for all lib packages"
@for lib in libs/arcade*/ ; do \
if [ -f "$$lib/pyproject.toml" ]; then \
echo "🛠️ Building $$lib"; \
(cd $$lib && uv build); \
fi; \
done
.PHONY: clean-build
clean-build: ## clean build artifacts
@echo "🗑️ Cleaning build artifacts"
@for lib in libs/arcade*/ ; do \
(cd $$lib && rm -rf dist); \
done
.PHONY: publish
publish: ## publish a release to pypi.
@echo "🚀 Publishing all lib packages to PyPI"
@for lib in libs/arcade*/ ; do \
if [ -f "$$lib/pyproject.toml" ]; then \
echo "📦 Publishing $$lib"; \
(cd $$lib && uv publish --token $(PYPI_TOKEN) || true); \
fi; \
done
.PHONY: build-and-publish
build-and-publish: build publish ## Build and publish.
.PHONY: docker
docker: ## Build and run the Docker container
@echo "🚀 Building lib packages..."
@make full-dist
@echo "🚀 Building Docker image"
@cd docker && make docker-build
@cd docker && make docker-run
.PHONY: publish-ghcr
publish-ghcr: ## Publish to the GHCR
@cd docker && make publish-ghcr
.PHONY: full-dist
full-dist: clean-dist ## Build all projects and copy wheels to ./dist
@echo "🛠️ Building a full distribution with lib packages"
@echo "🛠️ Building all lib packages and copying wheels to ./dist"
@mkdir -p dist
@for lib in arcade-core arcade-tdk arcade-serve ; do \
echo "🛠️ Building libs/$$lib wheel..."; \
(cd libs/$$lib && uv build); \
done
@echo "🛠️ Building arcade-mcp package and copying wheel to ./dist"
@uv build
@rm -f dist/*.tar.gz
.PHONY: clean-dist
clean-dist: ## Clean all built distributions
@echo "🗑️ Cleaning dist directory"
@rm -rf dist
@echo "🗑️ Cleaning libs/*/dist directories"
@for lib in libs/arcade*/ ; do \
rm -rf "$$lib"/dist; \
done
.PHONY: setup
setup: ## Run uv environment setup script
@chmod +x ./uv_setup.sh
@./uv_setup.sh
.PHONY: lint
lint: check ## Alias for check command
.PHONY: clean
clean: clean-build clean-dist ## Clean all build and distribution artifacts
.PHONY: help
help:
@echo "🛠️ Arcade Dev Commands:\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help
.PHONY: shell
shell: ## Open an interactive shell with the virtual environment activated
@if [ -f ".venv/bin/activate" ]; then \
. .venv/bin/activate && exec $$SHELL -l; \
else \
echo "⚠️ Virtual environment not found. Run 'make setup' first."; \
exit 1; \
fi