add Shiv-based build for standalone eris executable

- Add 'shiv' to dev dependencies in pyproject.toml
- Add dist/ to .gitignore
- Create packaging/build-shiv script: builds dist/eris zipapp via
  shiv -e eris.__main__:entry_point --compile-pyc --reproducible
- Update uv.lock
This commit is contained in:
Andrew Hamilton 2026-07-30 11:46:58 +10:00
parent 1f72a3cbc7
commit daba0d3eb4
4 changed files with 77 additions and 1 deletions

26
packaging/build-shiv Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
set -e
set -x
cd "$(dirname "$0")/.."
mkdir -p dist
REQS=$(mktemp)
uv export --no-dev --no-header --no-emit-project --no-hashes > "$REQS"
uv build --wheel --out-dir dist
WHEEL=$(ls dist/eris-*.whl 2>/dev/null | head -1)
if [ -z "$WHEEL" ]; then
echo "No wheel found in dist/" >&2
exit 1
fi
uv run shiv \
-e "eris.__main__:entry_point" \
-o dist/eris \
--compile-pyc \
--reproducible \
--no-deps \
-r "$REQS" \
"$WHEEL"
rm -f "$REQS" "$WHEEL"