Resolves https://linear.app/arcadedev/issue/TOO-788/mypy-failures-are-silently-dropped-during-arcade-mcp-ci <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: primarily CI/Makefile behavior and type-annotation tweaks; functional logic is unchanged aside from stricter failure propagation in `make check`. > > **Overview** > **Stops CI from silently ignoring mypy failures.** The `make check` target now runs `mypy` across `libs/arcade*/` and exits non-zero if any package fails, reporting the failed libs. > > Separately tightens typing to satisfy `mypy` (removing `type: ignore` on OAuth helpers, adding `cast()`/`Any` annotations for JSON response shapes and subprocess kwargs, and handling non-`str` `server_address` hosts), and bumps patch versions for `arcade-mcp` and `arcade-mcp-server`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e79575b13a2d03adf3548104a0064c643f1e21b1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
144 lines
4.2 KiB
Makefile
144 lines
4.2 KiB
Makefile
|
|
.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"
|
|
@failed_libs=""; for lib in libs/arcade*/ ; do \
|
|
echo "🔍 Type checking $$lib"; \
|
|
(cd $$lib && uv run mypy . --exclude tests) || failed_libs="$$failed_libs $$lib"; \
|
|
done; \
|
|
if [ -n "$$failed_libs" ]; then \
|
|
echo "❌ mypy failed in:$$failed_libs"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
.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
|