-
-
Notifications
You must be signed in to change notification settings - Fork 91
/
justfile
116 lines (90 loc) · 2.44 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
set positional-arguments
VERSION := `uv run scripts/get-version.py src/yutto/__version__.py`
BILIASS_VERSION := `uv run scripts/get-version.py packages/biliass/src/biliass/__version__.py`
DOCKER_NAME := "siguremo/yutto"
run *ARGS:
uv run python -m yutto {{ARGS}}
install:
uv sync
test:
uv run pytest -m '(api or e2e or processor or biliass) and not (ci_only or ignore)'
just clean
fmt:
uv run ruff format .
lint:
uv run pyright src/yutto packages/biliass/src/biliass tests
uv run ruff check .
uv run typos
build:
uv build
release:
@echo 'Tagging v{{VERSION}}...'
git tag "v{{VERSION}}"
@echo 'Push to GitHub to trigger publish process...'
git push --tags
publish:
uv build
uv publish
git push --tags
just clean-builds
clean:
fd \
-u \
-E tests/test_biliass/test_corpus/ \
-e m4s \
-e mp4 \
-e mkv \
-e mov \
-e aac \
-e mp3 \
-e flac \
-e srt \
-e xml \
-e ass \
-e nfo \
-e pb \
-e pyc \
-e jpg \
-e ini \
-x rm
rm -rf .pytest_cache/
rm -rf .mypy_cache/
find . -maxdepth 3 -type d -empty -print0 | xargs -0 -r rm -r
clean-builds:
rm -rf build/
rm -rf dist/
rm -rf yutto.egg-info/
generate-schema:
uv run scripts/generate-schema.py
ci-install:
uv sync --all-extras --dev
ci-fmt-check:
uv run ruff format --check --diff .
ci-lint:
just lint
ci-test:
uv run pytest -m "(api or processor or biliass) and not (ci_skip or ignore)" --reruns 3 --reruns-delay 1
ci-e2e-test:
uv run pytest -m "e2e and not (ci_skip or ignore)"
docker-run *ARGS:
docker run --rm -it -v `pwd`:/app {{DOCKER_NAME}} {{ARGS}}
docker-build:
docker build --no-cache -t "{{DOCKER_NAME}}:{{VERSION}}" -t "{{DOCKER_NAME}}:latest" .
docker-publish:
docker buildx build --no-cache --platform=linux/amd64,linux/arm64 -t "{{DOCKER_NAME}}:{{VERSION}}" -t "{{DOCKER_NAME}}:latest" . --push
# biliass specific
build-biliass:
cd packages/biliass; maturin build
develop-biliass *ARGS:
cd packages/biliass; maturin develop --uv {{ARGS}}
release-biliass:
@echo 'Tagging biliass@{{BILIASS_VERSION}}...'
git tag "biliass@{{BILIASS_VERSION}}"
@echo 'Push to GitHub to trigger publish process...'
git push --tags
snapshot-update:
uv run pytest tests/test_biliass/test_corpus --snapshot-update
fetch-corpus *ARGS:
cd tests/test_biliass/test_corpus; uv run scripts/fetch-corpus.py {{ARGS}}
test-corpus:
uv run pytest tests/test_biliass/test_corpus --capture=no -vv