-
-
Notifications
You must be signed in to change notification settings - Fork 347
Expand file tree
/
Copy pathjustfile
More file actions
132 lines (103 loc) · 3.16 KB
/
justfile
File metadata and controls
132 lines (103 loc) · 3.16 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Justfile for explainerdashboard development commands
# Install just: https://github.com/casey/just
# Default recipe - show available commands
default:
@just --list
# Install dependencies
install:
uv sync --all-extras
# Install dev dependencies (pre-commit, etc.)
install-dev:
uv sync --group dev
# Install only production dependencies
install-prod:
uv sync
# Install with test dependencies
install-test:
uv sync --extra test
# Install with docs dependencies
install-docs:
uv sync --extra docs
# Run all tests
test:
uv run pytest tests/
# Run all tests with coverage
test-cov:
uv run pytest --cov=explainerdashboard --cov-report=xml tests/
# Run all tests with HTML coverage report
test-cov-html:
uv run pytest --cov=explainerdashboard --cov-report=html tests/
@echo "Coverage report generated in htmlcov/index.html"
# Run only unit tests (exclude integration tests)
test-unit:
uv run pytest tests/ -k "not integration"
# Run only integration tests
test-integration:
uv run pytest tests/integration_tests/
# Run tests excluding selenium/integration tests (faster, no browser needed)
test-fast:
uv run pytest tests/ -k "not selenium and not integration"
# Run only CLI tests
test-cli:
uv run pytest -m cli tests/
# Run only selenium tests
test-selenium:
uv run pytest -m selenium tests/
# Run tests excluding selenium
test-no-selenium:
uv run pytest -m "not selenium" tests/
# Run a specific test file
test-file FILE:
uv run pytest tests/{{FILE}}
# Run a specific test function
test-func FILE FUNC:
uv run pytest tests/{{FILE}}::{{FUNC}}
# Lint with ruff
lint:
uv run ruff check --ignore=F405,F403,E402 .
# Format code with ruff
format:
uv run ruff format .
# Check formatting without making changes
format-check:
uv run ruff format --check .
# Run lint and format check
check:
just lint
just format-check
# Build the package
build:
uv build
# Clean build artifacts
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .eggs/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "htmlcov" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".coverage" -exec rm -f {} + 2>/dev/null || true
# Install pre-commit hooks
pre-commit-install:
uv run pre-commit install
# Run pre-commit hooks on all files
pre-commit-run:
uv run pre-commit run --all-files
# Run pre-commit hooks on staged files only
pre-commit-staged:
uv run pre-commit run
# Run all checks (lint, format, tests) before committing
pre-commit:
just lint
just format-check
just test-fast
# Show Python version
python-version:
uv run python --version
# Show package version
version:
uv run python -c "import explainerdashboard; print(explainerdashboard.__version__)"