-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
108 lines (83 loc) · 3.61 KB
/
Justfile
File metadata and controls
108 lines (83 loc) · 3.61 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
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
set shell := ["bash", "-euo", "pipefail", "-c"]
root := justfile_directory()
uv_project := "uv run --project '" + root + "' --no-sync"
cmake_cmd := uv_project + " python -c 'import shutil; print(shutil.which(\"cmake\") or \"\")'"
rapids_env := "export CMAKE=\"$(" + cmake_cmd + ")\"; eval \"$(" + uv_project + " python tools/rapids_env.py --format shell)\""
dist_dir := root + "/dist"
backend_wheel_compatibility := "manylinux_2_28"
default:
@just --list
apply-release-version tag:
{{uv_project}} python tools/apply_release_version.py --tag {{tag}}
show-release-version tag:
{{uv_project}} python tools/apply_release_version.py --tag {{tag}} --dry-run
sync-dev:
uv sync --group dev
sync-dev-no-project:
uv sync --group dev --no-install-project
loader-test: sync-dev
{{uv_project}} pytest -q tests/test_loader.py
backend-wheel: sync-dev
rm -rf dist
mkdir -p dist
{{rapids_env}} && cd backends/cuvs_26_02 && {{uv_project}} maturin build --release --locked --compatibility {{backend_wheel_compatibility}} --auditwheel skip --out ../../dist
backend-develop: sync-dev
{{rapids_env}} && cd backends/cuvs_26_02 && {{uv_project}} maturin develop --release --locked
build-wheels: sync-dev
rm -rf dist
mkdir -p dist
{{uv_project}} python -m py_compile \
python/lance_cuvs/__init__.py \
python/lance_cuvs/_loader.py \
backends/cuvs_26_02/python/lance_cuvs_backend_cu12/__init__.py
uv build --wheel --out-dir dist
{{rapids_env}} && cd backends/cuvs_26_02 && {{uv_project}} maturin build --release --locked --compatibility {{backend_wheel_compatibility}} --auditwheel skip --out ../../dist
python-build: build-wheels test-loader-wheel
@:
python-release: build-wheels
@:
rust-fmt-check:
cargo fmt --manifest-path backends/cuvs_26_02/Cargo.toml --all --check
rust-clippy: sync-dev-no-project
{{rapids_env}} && cargo clippy --manifest-path backends/cuvs_26_02/Cargo.toml --locked --all-targets --features python -- -D warnings
rust-check: sync-dev-no-project
{{rapids_env}} && cargo check --manifest-path backends/cuvs_26_02/Cargo.toml --locked --all-targets --features python
rust-build: rust-fmt-check rust-clippy rust-check
@:
test-loader-wheel:
@root_wheel="$(find '{{dist_dir}}' -maxdepth 1 -type f -name 'pylance_cuvs-*.whl' | head -n 1)"; \
test -n "$root_wheel"; \
tmpdir="$(mktemp -d)"; \
trap 'rm -rf "$tmpdir"' EXIT; \
uv venv --python 3.12 "$tmpdir/venv"; \
uv pip install --python "$tmpdir/venv/bin/python" pytest "$root_wheel"; \
"$tmpdir/venv/bin/python" -m pytest -q tests/test_loader.py
test-gpu-wheel:
@root_wheel="$(find '{{dist_dir}}' -maxdepth 1 -type f -name 'pylance_cuvs-*.whl' | head -n 1)"; \
backend_wheel="$(find '{{dist_dir}}' -maxdepth 1 -type f -name 'pylance_cuvs_cu12-*.whl' | head -n 1)"; \
test -n "$root_wheel"; \
test -n "$backend_wheel"; \
tmpdir="$(mktemp -d)"; \
trap 'rm -rf "$tmpdir"' EXIT; \
uv venv --python 3.12 "$tmpdir/venv"; \
uv pip install --python "$tmpdir/venv/bin/python" \
pytest \
pylance \
libcuvs-cu12==26.2.0 \
"$root_wheel" \
"$backend_wheel"; \
LANCE_CUVS_REQUIRE_GPU="${LANCE_CUVS_REQUIRE_GPU:-1}" "$tmpdir/venv/bin/python" -m pytest -q tests/test_smoke.py
gpu-smoke: build-wheels test-gpu-wheel
@:
container-shell:
tools/run_in_container.sh -- bash
container-python-build:
tools/run_in_container.sh -- just python-build
container-rust-build:
tools/run_in_container.sh -- just rust-build
container-python-release:
tools/run_in_container.sh -- just python-release
container-gpu-smoke:
tools/run_in_container.sh --gpu -- just gpu-smoke
container-backend-wheel:
tools/run_in_container.sh -- just backend-wheel