-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
159 lines (127 loc) · 4.69 KB
/
Copy pathjustfile
File metadata and controls
159 lines (127 loc) · 4.69 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Agent Packages Monorepo - Development Commands
# Usage: just <command> [args]
default:
@just --list
# ============================================================================
# Setup & Installation
# ============================================================================
# Install all packages in the workspace
install:
uv sync --all-groups
# Setup development environment
setup: install
uv tool install pre-commit --with pre-commit-uv
uv run pre-commit install
@echo "✓ Development environment ready"
# ============================================================================
# Quality Checks
# ============================================================================
# Run linting on all packages
lint:
uv run ruff check packages/*/src packages/*/tests
uv run bandit -c pyproject.toml -r packages -t B602,B603,B605,B607
# Run linting on a single package
lint-pkg pkg:
uv run ruff check packages/{{pkg}}/src packages/{{pkg}}/tests
uv run bandit -c pyproject.toml -r packages/{{pkg}}/src -t B602,B603,B605,B607
# Fix linting issues
lint-fix:
uv run ruff check --fix packages/*/src packages/*/tests
# Check code formatting
format:
uv run ruff format --check packages/*/src packages/*/tests
# Check code formatting for a single package
format-pkg pkg:
uv run ruff format --check packages/{{pkg}}/src packages/{{pkg}}/tests
# Fix code formatting
format-fix:
uv run ruff format packages/*/src packages/*/tests
# Run type checking on all packages
type-check:
uv run basedpyright
# Run type checking on a single package
type-check-pkg pkg:
uv run basedpyright packages/{{pkg}}/src
# Advisory dead-code scan with vulture. Not part of `check`/`ci` — expect false
# positives from the DI container, Protocol method definitions, and dynamic
# tool loading. Use as a periodic pre-refactor checklist, not a gate. The
# leading `-` makes just ignore the non-zero exit so findings don't break flow.
dead-code:
-uv run vulture
# Run all quality checks
check: lint format type-check
@echo "✓ All quality checks passed"
# Run all quality checks + tests for a single package
check-pkg pkg: (lint-pkg pkg) (format-pkg pkg) (type-check-pkg pkg) (test-pkg pkg)
@echo "✓ All checks passed for {{pkg}}"
# ============================================================================
# Testing
# ============================================================================
# Run all tests
test:
uv run pytest packages/*/tests -v
# Run tests for a specific package (uses the package's pytest + coverage config)
test-pkg pkg:
cd packages/{{pkg}} && uv run pytest
# ============================================================================
# Building
# ============================================================================
# Build a specific package
build pkg:
cd packages/{{pkg}} && uv build
# Build all packages
build-all:
#!/usr/bin/env bash
set -euo pipefail
for pkg in packages/*/; do
pkg_name=$(basename "$pkg")
echo "Building $pkg_name..."
(cd "$pkg" && uv build)
done
echo "✓ All packages built"
# Clean build artifacts and tooling caches
clean:
rm -rf build/
rm -rf dist/
rm -rf htmlcov/
rm -rf *.egg-info/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
rm -f .coverage
rm -rf packages/*/dist packages/*/build packages/*/*.egg-info
find . -type d -name __pycache__ -prune -exec rm -r {} +
find . -type f -name "*.pyc" -delete
@echo "✓ Cleaned build artifacts"
# Publish package to PyPI (requires PYPI_TOKEN env var)
publish pkg:
#!/usr/bin/env bash
set -euo pipefail
echo "Publishing {{pkg}}..."
cd packages/{{pkg}}
uv build
uv publish
echo "✓ Published {{pkg}}"
# ============================================================================
# Version Management
# ============================================================================
# Show version of a package
version pkg:
@uv run python scripts/bump_version.py {{pkg}} show
# Bump patch version (x.y.Z)
version-patch pkg:
uv run python scripts/bump_version.py {{pkg}} patch
# Bump minor version (x.Y.0)
version-minor pkg:
uv run python scripts/bump_version.py {{pkg}} minor
# Bump major version (X.0.0)
version-major pkg:
uv run python scripts/bump_version.py {{pkg}} major
# Set explicit version
version-set pkg version:
uv run python scripts/bump_version.py {{pkg}} set {{version}}
# ============================================================================
# Convenience Aliases
# ============================================================================
# Run all checks and tests (useful before creating PR)
ci: check test
@echo "✓ CI checks passed"