-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.justfile
More file actions
74 lines (62 loc) · 1.66 KB
/
.justfile
File metadata and controls
74 lines (62 loc) · 1.66 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
# Like GNU `make`, but `just` rustier.
# https://just.systems/
# run `just` from this directory to see available commands
alias i := install
alias u := update
alias p := pre_commit
alias b := build
alias r := run
alias t := test
alias ch := check
alias c := clean
alias f := format
alias a := add_scripts
# Default command when 'just' is run without arguments
default:
@just --list
# Install the virtual environment and pre-commit hooks
install:
@echo "Installing..."
@uv sync
@uv run pre-commit install --install-hooks
update:
@echo "Updating..."
@uv sync --upgrade
@uv run pre-commit autoupdate
# Run pre-commit
pre_commit:
@echo "Running pre-commit..."
@uv run pre-commit run -a
# Build the project
build target:
@echo "Building..."
@uv run hatch build --target {{target}}
# Run a package
run package="core" *args="":
@echo "Running..."
@uv run {{package}} {{args}}
# Test the project
test:
@echo "Testing..."
@uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=xml
# Run code quality tools
check:
@echo "Checking..."
@uv lock --locked
@uv run pre-commit run -a
# Remove build artifacts and non-essential files
clean:
@echo "Cleaning..."
@find . -type d -name ".venv" -exec rm -rf {} +
@find . -type d -name "__pycache__" -exec rm -rf {} +
@find . -type d -name ".pytest_cache" -exec rm -rf {} +
@find . -type d -name "*.ruff_cache" -exec rm -rf {} +
@find . -type d -name "*.egg-info" -exec rm -rf {} +
# Format the project
format:
@echo "Formatting..."
@find . -name "*.nix" -type f -exec nixfmt {} \;
# Add scripts
add_scripts:
@echo "Adding scripts..."
@uv add --script scripts/this.py 'typer>=0.12.5'