-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
94 lines (75 loc) · 2.38 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
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
# Set the default recipe to list all available commands
@default:
@just --list
#Set the uv command to run a tool
uv-tool := "uv tool run"
# Run Ruff linting
@lint:
{{uv-tool}} ruff check
# Run tests wth pytest
@test:
uv run pytest
# Run nox
@nox:
{{uv-tool}} nox --session test
# Run Ruff formatting
@format:
{{uv-tool}} ruff format
# Sync the package
@sync:
uv sync --all-extras
# Sync the package
@sync-up:
uv sync --all-extras --upgrade
# Lock the package version
@lock:
uv lock
# Build the package
@build:
uv build
# Publish the package - this requires a $HOME/.pypirc file with your credentials
@publish:
rm -rf ./dist/*
uv build
{{uv-tool}} twine check dist/*
{{uv-tool}} twine upload dist/*
# Install pre-commit hooks
@pc-install:
{{uv-tool}} pre-commit install
# Upgrade pre-commit hooks
@pc-up:
{{uv-tool}} pre-commit autoupdate
# Run pre-commit hooks
@pc-run:
{{uv-tool}} pre-commit run --all-files
# Use BumpVer to increase the patch version number. Use just bump -d to view a dry-run.
@bump *ARGS:
uv run bumpver update --patch {{ ARGS }}
uv sync --all-extras
git add uv.lock
git commit -m "Bump version"
git push
# Use BumpVer to increase the minor version number. Use just bump -d to view a dry-run.
@bump-minor *ARGS:
uv run bumpver update --minor {{ ARGS }}
uv sync --all-extras
git add uv.lock
git commit -m "Bump version"
git push
# Use BumpVer to increase the major version number. Use just bump -d to view a dry-run.
@bump-major *ARGS:
uv run bumpver update --major {{ ARGS }}
uv sync --all-extras
git add uv.lock
git commit -m "Bump version"
git push
# Create a new GitHub release - this requires Python 3.11 or newer, and the GitHub CLI must be installed and configured
version := `echo "from tomllib import load; print(load(open('pyproject.toml', 'rb'))['project']['version'])" | uv run - `
[confirm("Are you sure you want to create a new release?\nThis will create a new GitHub release and will build and deploy a new version to PyPi.\nYou should have already updated the version number using one of the bump recipes.\nTo check the version number, run just version.\n\nCreate release?")]
@release:
echo "Creating a new release for v{{version}}"
git pull
gh release create "v{{version}}" --generate-notes
@version:
git pull
echo {{version}}