-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
77 lines (56 loc) · 1.71 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
NAME:='hypergrid'
DEV_IMAGE:='ghcr.io/iomorphic/image/dev-py:latest'
SRC_FOLDER:='src'
TEST_FOLDER:='tests'
@default:
just --list
@init:
[ -f uv.lock ] && echo "Lockfile already exists" || uv lock
uv sync
@build:
uv build
@verify: lint typecheck test
echo "Done with Verification"
@lint:
uv run ruff check {{SRC_FOLDER}} {{TEST_FOLDER}}
uv run ruff format --check {{SRC_FOLDER}} {{TEST_FOLDER}}
@typecheck:
uv run mypy --explicit-package-bases -p {{NAME}}
uv run mypy --allow-untyped-defs tests
@test:
uv run pytest --hypothesis-show-statistics {{TEST_FOLDER}}
@format:
uv run ruff check --fix-only {{SRC_FOLDER}} {{TEST_FOLDER}}
uv run ruff format {{SRC_FOLDER}} {{TEST_FOLDER}}
@stats:
uv run coverage run -m pytest {{TEST_FOLDER}}
uv run coverage report -m
scc --by-file --include-ext py
# docker host-mapped venv cannot be shared for localdev; container modified files not remapped to host user
virt SUBCOMMAND FORCE="noforce":
#!/usr/bin/env bash
if [ "{{FORCE}}" = "--force" ] || [ "{{FORCE}}" = "-f" ]; then
docker container prune --force
docker volume rm --force {{NAME}}_pyvenv
fi
docker run -i -v `pwd`:`pwd` -v {{NAME}}_pyvenv:`pwd`/.venv -w `pwd` {{DEV_IMAGE}} just init {{SUBCOMMAND}}
@cicd-pr: init verify
echo "PR is successful!"
@cicd-register:
git diff --name-only HEAD^1 HEAD -G"^version" "pyproject.toml" | uniq | xargs -I {} sh -c 'just _register'
@_register: init build
uv publish -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
@lock:
uv lock
@sync:
uv sync
@repl:
uv run python
@run +COMMAND:
uv run {{COMMAND}}
######
## Custom Section Begin
######
######
## Custom Section End
######