-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
60 lines (49 loc) · 1.15 KB
/
justfile
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
list-tasks:
@just --list
# Initialize a new project
init:
git init
git commit --allow-empty -m "Initial commit"
git add --all
git commit -m "🚀 Initialized project using https://github.com/tsvikas/python-template"
@just update-deps
git add --all
git commit -m "⬆️ Updated project dependencies"
@just prepare
# Update all dependencies
update-deps:
uv sync --upgrade
uv run pre-commit autoupdate -j "$(nproc)"
# Setup the project. Needed after cloning
prepare:
uv run pre-commit install
check-and-push:
@just check
git push
format-and-check:
@just format
@just check
# Run all code quality checks and tests, except pylint
check:
uv run pytest
uv run mypy
uv run pre-commit run --all-files --show-diff-on-failure
# Format code and files
format:
just isort
uv run black .
uv run pre-commit run --all-files blacken-docs
uv run pre-commit run --all-files mdformat
# Sort imports (using ruff)
isort:
uv run ruff check --select I001 --fix
# Run linters: ruff and mypy
lint:
uv run ruff check
uv run mypy
# Run Pylint, might be slow
pylint:
uv run --with pylint pylint src
# Run tests with pytest
test:
uv run pytest