Files
MX_Pmodule/careless/build
T
duan_jandClaude Fable 5 b55d6c1d91 Split careless into CPU module and careless-gpu using cuda/12.8.1 module
careless installs plain careless (CPU). careless-gpu also installs plain
careless but declares cuda/12.8.1 as build_requires/runtime_deps
(jfjoch_viewer pattern) instead of pip-bundling CUDA via the [cuda] extra.
Both builds honor UV_CACHE_DIR to share one download cache.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 11:07:12 +02:00

32 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env modbuild
pbuild::prep() {
:
}
pbuild::configure() {
# repo.anaconda.com is unreachable from Ra (GnuTLS error), so no conda.
# uv fetches a standalone CPython instead; keep it inside PREFIX so the
# venv's interpreter symlinks don't depend on the builder's home cache.
UV="${UV:-$HOME/.local/bin/uv}"
# ~/.cache/uv hits the home disk quota; default the cache into PREFIX.
# Overridable so careless and careless-gpu can share one cache:
# UV_CACHE_DIR=<shared path> modbuild build <version>
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
"$UV" venv --python 3.12 "$PREFIX/venv"
}
pbuild::compile() {
:
}
pbuild::install() {
UV="${UV:-$HOME/.local/bin/uv}"
export UV_CACHE_DIR="${UV_CACHE_DIR:-$PREFIX/.uv-cache}"
# CPU version; the GPU build with the [cuda] extra is the careless-gpu module
"$UV" pip install --python "$PREFIX/venv/bin/python" "careless==${V_PKG}"
# only auto-remove the cache if it lives inside this PREFIX (never a shared one)
[[ "$UV_CACHE_DIR" == "$PREFIX"* ]] && rm -rf "$UV_CACHE_DIR" || :
}