-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (72 loc) · 2.31 KB
/
Makefile
File metadata and controls
89 lines (72 loc) · 2.31 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
.PHONY: help install install-dev test test-quick lint format type-check clean build docs example-docs build-all-docs serve-docs serve-examples ci-test prepare-release generate-badges
help:
@echo "Available commands:"
@echo " install - Install package"
@echo " install-dev - Install package in development mode"
@echo " test - Run tests with coverage"
@echo " test-quick - Run tests quickly"
@echo " lint - Run linting"
@echo " format - Format code"
@echo " type-check - Run type checking"
@echo " clean - Clean build artifacts"
@echo " build - Build package"
@echo " docs - Build documentation"
@echo " example-docs - Build example documentation"
@echo " build-all-docs - Build all documentation"
@echo " serve-docs - Serve documentation locally"
@echo " serve-examples - Serve examples locally"
@echo " ci-test - Run full CI test suite"
@echo " prepare-release - Prepare for release"
@echo " generate-badges - Generate coverage badge"
install:
pip install .
install-dev:
pip install -e .[dev]
test:
pytest --cov=jsonschema_diff --cov-report=xml --cov-report=html --cov-report=term-missing
test-quick:
pytest --tb=short
lint:
flake8 jsonschema_diff/ tests/
black --check jsonschema_diff/ tests/
isort --check-only jsonschema_diff/ tests/
format:
black jsonschema_diff/ tests/
isort jsonschema_diff/ tests/
type-check:
mypy jsonschema_diff/
clean:
rm -rf build/ dist/ *.egg-info/
rm -rf docs/_build/ examples/docs/_build/
rm -rf htmlcov/ .coverage coverage.xml coverage.svg
rm -rf .pytest_cache/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
build: clean
python -m build
build-install:
$(MAKE) build
$(MAKE) install
docs:
cd docs && sphinx-build -b html source _build/html
serve-docs:
cd docs/_build/html && python -m http.server 8000
# CI simulation
ci-test:
$(MAKE) lint
$(MAKE) type-check
$(MAKE) test
$(MAKE) build
$(MAKE) build-all-docs
# Release preparation
prepare-release:
$(MAKE) clean
$(MAKE) ci-test
$(MAKE) build
twine check dist/*
# Badge generation
generate-badges:
pytest --tb=short > test_results.txt 2>&1 || true
pip install coverage-badge
coverage-badge -o coverage.svg
all: format lint type-check test