-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (82 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
98 lines (82 loc) · 2.02 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
# XTools Development Makefile
# Run common development tasks locally
.PHONY: help install dev lint format test build clean publish
# Default target
help:
@echo "XTools Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install XTools"
@echo " make dev Install with dev dependencies"
@echo " make browser Install Playwright browser"
@echo ""
@echo "Code Quality:"
@echo " make lint Run linter (ruff)"
@echo " make format Format code (black)"
@echo " make typecheck Run type checker (mypy)"
@echo " make check Run all checks"
@echo ""
@echo "Testing:"
@echo " make test Run tests"
@echo " make coverage Run tests with coverage"
@echo ""
@echo "Build:"
@echo " make build Build package"
@echo " make publish Publish to PyPI"
@echo " make clean Clean build artifacts"
@echo ""
@echo "Docs:"
@echo " make docs Serve docs locally"
@echo " make docs-build Build docs"
# Installation
install:
pip install .
dev:
pip install -e ".[dev,ai]"
playwright install chromium
browser:
playwright install chromium
playwright install-deps chromium
# Code Quality
lint:
ruff check xtools/
format:
black xtools/
ruff check --fix xtools/
typecheck:
mypy xtools/ --ignore-missing-imports
check: lint typecheck
@echo "All checks passed!"
# Testing
test:
pytest xtools/tests/ -v
coverage:
pytest xtools/tests/ --cov=xtools --cov-report=html --cov-report=term
@echo "Coverage report: htmlcov/index.html"
# Build
build: clean
pip install build
python -m build
@echo "Build complete! Check dist/"
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf xtools/*.egg-info/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
rm -rf .mypy_cache/
rm -rf htmlcov/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@echo "Cleaned!"
publish: build
pip install twine
twine check dist/*
@echo ""
@echo "Ready to publish! Run:"
@echo " twine upload dist/*"
# Documentation
docs:
mkdocs serve
docs-build:
mkdocs build