Skip to content

Commit b3704f5

Browse files
Add justfile
Co-authored-by: Audrey Roy Greenfeld <[email protected]>
1 parent 28b347b commit b3704f5

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

justfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
# Generate project using defaults
3+
bake BAKE_OPTIONS="--no-input":
4+
cookiecutter {{BAKE_OPTIONS}} . --overwrite-if-exists
5+
6+
# Watch for changes
7+
watch BAKE_OPTIONS="--no-input": bake
8+
watchmedo shell-command \
9+
-p '*.*' \
10+
-c 'just bake {{BAKE_OPTIONS}}' \
11+
-W -R -D {{'{{cookiecutter.project_slug}}'}}
12+
13+
# replay: BAKE_OPTIONS="--replay"
14+
# replay: watch
15+
# ;
16+
17+
18+
# Run all the tests, but allow for arguments to be passed
19+
test *ARGS:
20+
@echo "Running with arg: {{ARGS}}"
21+
uv run --python=3.13 --extra dev pytest {{ARGS}}
22+
23+
# Run all the tests, but on failure, drop into the debugger
24+
pdb *ARGS:
25+
@echo "Running with arg: {{ARGS}}"
26+
uv run --python=3.13 --with pytest --with httpx pytest --pdb --maxfail=10 --pdbcls=IPython.terminal.debugger:TerminalPdb {{ARGS}}
27+
28+
29+
30+
# Build the project, useful for checking that packaging is correct
31+
build:
32+
rm -rf build
33+
rm -rf dist
34+
uv build
35+
36+
VERSION := `grep -m1 '^version' pyproject.toml | sed -E 's/version = "(.*)"/\1/'`
37+
38+
# Print the current version of the project
39+
version:
40+
@echo "Current version is {{VERSION}}"
41+
42+
# Tag the current version in git and put to github
43+
tag:
44+
echo "Tagging version v{{VERSION}}"
45+
git tag -a v{{VERSION}} -m "Creating version v{{VERSION}}"
46+
git push origin v{{VERSION}}
47+
48+
# Run all the formatting, linting, and testing commands
49+
clean:
50+
ruff format .
51+
ruff check . --fix
52+
ruff check --select I --fix .
53+
pytest

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies = [
3232
"typer>=0.16.0",
3333
"alabaster>=1.0.0",
3434
"watchdog>=6.0.0",
35+
"rust-just>=1.42.4",
3536
]
3637

3738
[project.urls]

uv.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)