.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 --dev --extra all @uv run pre-commit install @echo "โœ… All packages and dependencies installed via uv workspace" .PHONY: install-toolkits install-toolkits: ## Install dependencies for all toolkits @echo "๐Ÿš€ Installing dependencies for all toolkits" @failed=0; \ successful=0; \ for dir in toolkits/*/ ; do \ if [ -d "$$dir" ] && [ -f "$$dir/pyproject.toml" ]; then \ echo "๐Ÿ“ฆ Installing dependencies for $$dir"; \ if (cd $$dir && uv pip install -e ".[dev]"); then \ successful=$$((successful + 1)); \ else \ echo "โŒ Failed to install dependencies for $$dir"; \ failed=$$((failed + 1)); \ fi; \ else \ echo "โš ๏ธ Skipping $$dir (no pyproject.toml found)"; \ fi; \ done; \ echo ""; \ echo "๐Ÿ“Š Installation Summary:"; \ echo " โœ… Successful: $$successful toolkits"; \ echo " โŒ Failed: $$failed toolkits"; \ if [ $$failed -gt 0 ]; then \ echo ""; \ echo "โš ๏ธ Some toolkit installations failed. Check the output above for details."; \ exit 1; \ else \ echo ""; \ echo "๐ŸŽ‰ All toolkit dependencies installed successfully!"; \ fi .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: check-toolkits check-toolkits: ## Run code quality tools for each toolkit that has a Makefile @echo "๐Ÿš€ Running 'make check' in each toolkit with a Makefile" @for dir in toolkits/*/ ; do \ if [ -f "$$dir/Makefile" ]; then \ echo "๐Ÿ› ๏ธ Checking toolkit $$dir"; \ (cd "$$dir" && uv run pre-commit run -a && uv run mypy --config-file=pyproject.toml); \ else \ echo "๐Ÿ› ๏ธ Skipping toolkit $$dir (no Makefile found)"; \ fi; \ done .PHONY: test test: ## 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: test-toolkits test-toolkits: ## Iterate over all toolkits and run pytest on each one @echo "๐Ÿš€ Testing code in toolkits: Running pytest" @for dir in toolkits/*/ ; do \ toolkit_name=$$(basename "$$dir"); \ echo "๐Ÿงช Testing $$toolkit_name toolkit"; \ (cd $$dir && uv run pytest -W ignore -v --cov=arcade_$$toolkit_name --cov-report=xml || exit 1); \ 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: build-toolkits build-toolkits: ## Build wheel files for all toolkits @echo "๐Ÿš€ Creating wheel files for all toolkits" @failed=0; \ successful=0; \ for dir in toolkits/*/ ; do \ if [ -d "$$dir" ] && [ -f "$$dir/pyproject.toml" ]; then \ toolkit_name=$$(basename "$$dir"); \ echo "๐Ÿ› ๏ธ Building toolkit $$toolkit_name"; \ if (cd $$dir && uv build); then \ successful=$$((successful + 1)); \ else \ echo "โŒ Failed to build toolkit $$toolkit_name"; \ failed=$$((failed + 1)); \ fi; \ else \ echo "โš ๏ธ Skipping $$dir (no pyproject.toml found)"; \ fi; \ done; \ echo ""; \ echo "๐Ÿ“Š Build Summary:"; \ echo " โœ… Successful: $$successful toolkits"; \ echo " โŒ Failed: $$failed toolkits"; \ if [ $$failed -gt 0 ]; then \ echo ""; \ echo "โš ๏ธ Some toolkit builds failed. Check the output above for details."; \ exit 1; \ else \ echo ""; \ echo "๐ŸŽ‰ All toolkit wheels built successfully!"; \ fi .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 and toolkit wheels..." @make full-dist @echo "๐Ÿš€ Building Docker image" @cd docker && make docker-build @cd docker && make docker-run .PHONY: docker-base docker-base: ## Build and run the Docker container @echo "๐Ÿš€ Building lib packages and toolkit wheels..." @make full-dist @echo "๐Ÿš€ Building Docker image" @cd docker && INSTALL_TOOLKITS=false make docker-build @cd docker && INSTALL_TOOLKITS=false make docker-run .PHONY: publish-ghcr publish-ghcr: ## Publish to the GHCR # Publish the base image - ghcr.io/arcadeai/worker-base @cd docker && INSTALL_TOOLKITS=false make publish-ghcr # Publish the image with toolkits - ghcr.io/arcadeai/worker @cd docker && INSTALL_TOOLKITS=true 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 and toolkits" @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 @echo "๐Ÿ› ๏ธ Building all toolkit packages and copying wheels to ./dist" @for dir in toolkits/*/ ; do \ if [ -d "$$dir" ] && [ -f "$$dir/pyproject.toml" ]; then \ toolkit_name=$$(basename "$$dir"); \ echo "๐Ÿ› ๏ธ Building toolkit $$toolkit_name wheel..."; \ (cd $$dir && uv build); \ cp $$dir/dist/*.whl dist/; \ fi; \ done .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 @echo "๐Ÿ—‘๏ธ Cleaning toolkits/*/dist directory" @for toolkit_dir in toolkits/*; do \ if [ -d "$$toolkit_dir" ]; then \ rm -rf "$$toolkit_dir"/dist; \ fi; \ 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