-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (89 loc) · 2.54 KB
/
Makefile
File metadata and controls
113 lines (89 loc) · 2.54 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Copyright (c) 2025 Maxim Ivanov
# SPDX-License-Identifier: MIT
.PHONY: help tests lint format typecheck build publish clean install-dev
# Default target
help:
@echo "Available commands:"
@echo " make install-dev - Install development dependencies"
@echo " make tests - Run tests with coverage"
@echo " make lint - Run linting checks"
@echo " make format - Format code"
@echo " make typecheck - Run type checking"
@echo " make check - Run all checks (lint, format, typecheck, tests)"
@echo " make build - Build package"
@echo " make publish - Build and publish to PyPI"
@echo " make clean - Clean build artifacts"
# Install development dependencies
install-dev:
pip install -e ".[dev]"
# Run tests with coverage
tests:
python -m pytest --cov=src/xmlassert --cov-report=term-missing --cov-report=html -v
# Run linting checks
lint:
ruff check src/xmlassert tests
# Format code
format:
ruff check --select I --fix # fix imports
ruff format src/xmlassert tests
# Check formatting without making changes
format-check:
ruff format --check src/xmlassert tests
# Run type checking
typecheck:
mypy src/xmlassert tests
# Run all checks: lint, format check, typecheck, and tests
check: lint format-check typecheck tests
# Build package
build:
python -m build
# Build and publish to PyPI (requires TWINE_USERNAME and TWINE_PASSWORD)
publish: build
python -m twine upload dist/*
# Clean build artifacts
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .ruff_cache/
rm -rf .mypy_cache/
rm -rf .pytest_cache/
rm -rf htmlcov/
rm -rf .coverage
rm -rf coverage.xml
# Install package in development mode
develop:
pip install -e .
# Run tests in watch mode (requires pytest-watch)
watch:
ptw --onpass "echo ? Tests passed" --onfail "echo ? Tests failed"
# Generate coverage report
coverage:
python -m pytest --cov=src/xmlassert --cov-report=html
@echo "Coverage report generated at htmlcov/index.html"
# Check for security vulnerabilities
safety:
pip install safety
safety check
# Update dependencies
update-deps:
pip install --upgrade pip
pip install --upgrade -e ".[dev]"
# Show dependency tree
deps-tree:
pip install pipdeptree
pipdeptree
# Run benchmarks (if you add benchmarks later)
benchmark:
@echo "Benchmarks not yet implemented"
# Helpers for CI
ci-install:
pip install -e ".[dev]"
ci-test:
python -m pytest --cov=src/xmlassert --cov-report=xml
ci-lint:
ruff check src/xmlassert tests
ci-format:
ruff format --check src/xmlassert tests
ci-typecheck:
mypy src/xmlassert tests