-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (30 loc) · 1.3 KB
/
Makefile
File metadata and controls
43 lines (30 loc) · 1.3 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
.DEFAULT_GOAL := help
.PHONY: help install lint typecheck test test-cli test-all test-remote clean build publish
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Install package in editable mode with dev deps
pip install -e ".[dev]"
lint: ## Run ruff linter and formatter check
ruff check src/ tests/
ruff format --check src/ tests/
format: ## Auto-format code with ruff
ruff check --fix src/ tests/
ruff format src/ tests/
typecheck: ## Run mypy type checking
mypy src/modelscope_hub/
test: ## Run unit tests only (no remote API calls)
pytest tests/ -k "not remote" --ignore=tests/integration
test-cli: ## Run CLI unit tests only (no remote API calls)
python tests/cli/run_all.py
test-all: ## Run all tests including integration (needs tests/.env)
pytest tests/
test-remote: ## Run only remote integration tests
pytest tests/ -m remote
clean: ## Remove build artifacts and caches
rm -rf build/ dist/ *.egg-info src/*.egg-info
rm -rf .pytest_cache .mypy_cache .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
build: clean ## Build source and wheel distributions
python -m build
publish: build ## Upload to PyPI (requires twine)
twine upload dist/*