-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (43 loc) · 1.88 KB
/
Makefile
File metadata and controls
58 lines (43 loc) · 1.88 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
.PHONY: help install format lint check test clean build publish publish-test
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies
poetry install --with dev,format
format: ## Format code with ruff
poetry run ruff format --config=pyproject.toml .
lint: ## Lint code with ruff
poetry run ruff check --config=pyproject.toml .
fix: ## Fix linting issues with ruff
poetry run ruff check --config=pyproject.toml --fix .
check: ## Run all checks (lint + type check)
poetry run ruff check --config=pyproject.toml .
poetry run mypy --config-file=pyproject.toml .
test: ## Run tests
poetry run pytest tests/ -v
test-cov: ## Run tests with coverage
poetry run pytest tests/ -v --cov=dify_oapi --cov-report=html --cov-report=term
clean: ## Clean build artifacts
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name ".ruff_cache" -exec rm -rf {} +
build: ## Build package
poetry build
publish: clean build ## Build and publish package to PyPI
poetry publish
publish-test: clean build ## Build and publish package to TestPyPI
poetry publish --repository testpypi
pre-commit: ## Run pre-commit hooks
poetry run pre-commit run --all-files
install-hooks: ## Install pre-commit hooks
poetry run pre-commit install
poetry run pre-commit install --hook-type commit-msg
dev-setup: install install-hooks ## Setup development environment
@echo "Development environment setup complete!"
@echo "VS Code users: Install the recommended extensions for the best experience."
@echo "Run 'make help' to see available commands."