Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
82 lines (60 loc) · 2.36 KB
/
Copy pathjustfile
File metadata and controls
82 lines (60 loc) · 2.36 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
ruff_config := "--config pyproject.toml"
pytest_opts := "--doctest-modules --no-qt-log"
@default:
just --list
build-js:
uv run python scripts/build-inject-js.py
run: build-js dev-setup
LOGURU_LEVEL=DEBUG uv run python -m pxmodrim
test: build-js dev-setup
QT_QPA_PLATFORM=offscreen uv run pytest {{pytest_opts}} -s
test-verbose: build-js dev-setup
QT_QPA_PLATFORM=offscreen uv run pytest {{pytest_opts}} -v --tb=short -s
pyright:
uv run python -m pyright -p pyproject.toml src/ tests/
ruff-fix:
uv run ruff check {{ruff_config}} src/ tests/ scripts/ packaging/ --fix
ruff-format-fix:
uv run ruff format {{ruff_config}} src/ tests/ scripts/ packaging/
ruff-check:
uv run ruff check {{ruff_config}} src/ tests/ scripts/ packaging/
ruff-format-check:
uv run ruff format --check {{ruff_config}} src/ tests/ scripts/ packaging/
fix: ruff-fix ruff-format-fix
check: ruff-check ruff-format-check build-js pyright check-deps
check-deps:
uv run python scripts/check-deps.py
ci: check test
dev-setup:
uv venv --allow-existing
uv sync --dev
linux-copy-desktop:
mkdir -p ~/.local/share/applications
sed "s|Icon=pxmodrim|Icon={{justfile_directory()}}/src/pxmodrim/ui/assets/logo.svg|" packaging/linux/pxmodrim.desktop > ~/.local/share/applications/pxmodrim.desktop
kbuildsycoca6 --noincremental
bench name="":
#!/usr/bin/env python3
import glob, subprocess, sys
from pathlib import Path
root = Path("{{justfile_directory()}}") / "tests" / "benchmarks"
scripts = sorted(glob.glob(str(root / "bench_*.py")))
name = "{{name}}"
if name and name != "all":
scripts = [s for s in scripts if name in s]
if not scripts:
print("no benchmark found"); sys.exit(1)
for s in scripts:
print(f" === {Path(s).stem} ===")
subprocess.run(["uv", "run", "python", s])
build *args: build-js
uv run python packaging/build.py {{args}}
build-release *args: build-js
uv run python packaging/build.py --release {{args}}
build-release-bundled *args: build-js
uv run python packaging/build.py --release --bundle-qt {{args}}
build-clean:
rm -rf build/ dist/ *.build/ *.dist/ *.onefile-build/
clean:
rm -rf build/ dist/ *.egg-info
rm -rf .pytest_cache .mypy_cache .ruff_cache
find . -path ./rimsort-original -prune -o -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true