-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathJustfile
More file actions
97 lines (81 loc) · 2.31 KB
/
Justfile
File metadata and controls
97 lines (81 loc) · 2.31 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
set quiet := true
# Show all recipes
help:
@just --list --unsorted
# Clean up all untracked files (including those in .gitignore)
[group("housekeeping")]
clean:
echo "> Cleaning up all untracked files..."
git clean -fdx
# Set up and validate development dependencies
[group("housekeeping")]
setup:
echo "> Installing pre-commit hooks..."
pre-commit install
uv sync --dev
# Run python tests. Docker is required to run the tests.
[group("tests")]
pytest:
echo "> Running python tests..."
uv run --frozen pytest -v
# Lint and check the codebase
[group("tests")]
lint:
echo "> Running ruff code quality check..."
uv run --frozen ruff check
echo "> Running ruff format check..."
uv run --frozen ruff format --check
# Run mypy type checks
[group("tests")]
mypy:
echo "> Running mypy checks..."
uv run --frozen mypy python_ntfy
# Run ruff format
[group("tests")]
format:
echo "> Running ruff formater and fixer..."
uv run ruff format
uv run ruff check --fix
echo "> Running just format..."
just --fmt --unstable
# Run all tests
[group("tests")]
test: lint mypy pytest
# Audit dependencies for security vulnerabilities
[group("Security")]
audit:
uvx uv-secure uv.lock
# Build mkdocs site
[group("docs")]
build-docs:
echo "> Building docs..."
uv run mkdocs build
# Serve mkdocs site and watch for changes
[group("docs")]
serve-docs: build-docs
echo "> Serving docs..."
uv run mkdocs serve --open -w docs -w python_ntfy
# Build the package
[group("release")]
build:
rm -rf dist
echo "> Building package..."
uv build
# Bump version, push and create draft release
[confirm("Are you sure you want to draft a release? [y/N]")]
[group("release")]
draft-release bump='patch': (_bump_version bump) _push_version _create_draft_release
_bump_version bump:
git checkout main
git pull origin main
git reset # Unstage all files
@just build
uv version --bump {{ bump }}
git add pyproject.toml uv.lock
[confirm("Are you sure you want to push the version change? [y/N]")]
_push_version:
git commit -m "Bumped version to $(uv version --short)"
git push origin main
_create_draft_release:
gh release create $(uv version --short) dist/python_ntfy* --draft --generate-notes
echo "> Follow the link to review and publish the release"