Keep setup bootstrap aligned with locked abxpkg

This commit is contained in:
Nick Sweeting 2026-08-15 01:32:13 -07:00
parent f2467197fa
commit 79d47de611
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import os
import shutil
import subprocess
import tomllib
from pathlib import Path
@ -34,10 +35,12 @@ def test_setup_script_gives_archivebox_user_ownership_of_runtime_parent_dirs():
def test_setup_script_bootstraps_locked_abxpkg_version():
script = SETUP_SCRIPT.read_text()
lock = tomllib.loads((SETUP_SCRIPT.parents[1] / "uv.lock").read_text())
locked_abxpkg_version = next(package["version"] for package in lock["package"] if package["name"] == "abxpkg")
prepare_function = script.partition("prepare_abxpkg_environment() {")[2].partition("\n}")[0]
install_function = script.partition("install_archivebox_with_uv() {")[2].partition("\n}")[0]
assert 'ABXPKG_PACKAGE="${ABXPKG_PACKAGE:-abxpkg==1.12.79}"' in script
assert f'ABXPKG_PACKAGE="${{ABXPKG_PACKAGE:-abxpkg=={locked_abxpkg_version}}}"' in script
assert 'ARCHIVEBOX_PACKAGE="${ARCHIVEBOX_PACKAGE:-archivebox>=0.9.0rc0,<0.10}"' in script
assert '--prerelease explicit --upgrade "$ARCHIVEBOX_PACKAGE"' in install_function
assert "fix_root_install_ownership" in prepare_function

View File

@ -81,7 +81,7 @@ ARCHIVEBOX_PYTHON="${ARCHIVEBOX_PYTHON:-3.13}"
ARCHIVEBOX_PACKAGE="${ARCHIVEBOX_PACKAGE:-archivebox>=0.9.0rc0,<0.10}"
ARCHIVEBOX_PLATFORM="${ARCHIVEBOX_PLATFORM:-}"
ARCHIVEBOX_COMPOSE_URL="${ARCHIVEBOX_COMPOSE_URL:-https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/${ARCHIVEBOX_BRANCH}/docker-compose.yml}"
ABXPKG_PACKAGE="${ABXPKG_PACKAGE:-abxpkg==1.12.79}"
ABXPKG_PACKAGE="${ABXPKG_PACKAGE:-abxpkg==1.12.81}"
ABXPKG_LIB_DIR="${ABXPKG_LIB_DIR:-$HOME/.cache/archivebox/setup-abxpkg}"
ARCHIVEBOX_HOME_DIR="$HOME/archivebox"
ARCHIVEBOX_DATA_DIR="$ARCHIVEBOX_HOME_DIR/data"