Skip to content

Commit 911f91e

Browse files
committed
update: add piwheels for older architectures, horribly slow builds otherwise
1 parent 27f15e4 commit 911f91e

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

install.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ WEB_SERVICE_NAME="cursed-controls-web.service"
3434
UV_BIN="$INSTALL_HOME/.local/bin/uv"
3535
PYTHON_REQUEST="$(cat "$CC_DIR/.python-version" 2>/dev/null || echo "3.13")"
3636
NEED_REBOOT=0
37+
UV_SYNC_INDEX_ARGS=()
3738

3839
info() { echo "[cursed-controls] $*"; }
3940
ok() { echo "[cursed-controls] ✓ $*"; }
@@ -57,6 +58,11 @@ case "$ARCH" in
5758
esac
5859
BUILD_JOBS="$(nproc)"
5960
[ "$BUILD_JOBS" -gt 4 ] && BUILD_JOBS=4
61+
if [ "$ARCH" = "armv6l" ]; then
62+
UV_SYNC_INDEX_ARGS=(
63+
--index "piwheels=https://www.piwheels.org/simple"
64+
)
65+
fi
6066

6167
# ── 2. Show detected hardware (UDC is resolved at runtime via /sys/class/udc) ─
6268
MODEL="$(cat /sys/firmware/devicetree/base/model 2>/dev/null | tr -d '\0' || echo 'unknown')"
@@ -247,7 +253,12 @@ if [ ! -d "$CC_DIR/.venv" ]; then
247253
"$UV_BIN" venv --python "$PYTHON_REQUEST" "$CC_DIR/.venv"
248254
fi
249255
info "Syncing Python dependencies with uv..."
250-
"$UV_BIN" sync --directory "$CC_DIR" --python "$PYTHON_REQUEST" --no-dev --locked
256+
"$UV_BIN" sync \
257+
--directory "$CC_DIR" \
258+
--python "$PYTHON_REQUEST" \
259+
--no-dev \
260+
--locked \
261+
"${UV_SYNC_INDEX_ARGS[@]}"
251262
ok "Python env"
252263

253264
# ── 12. Seed default mapping and prepare init script ──────────────────────────

tests/test_install_assets.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ def test_install_script_uses_uv_for_python_env():
114114
assert "UV_BIN" in install
115115

116116

117+
def test_install_script_uses_piwheels_on_armv6_with_uv():
118+
install = (REPO_ROOT / "install.sh").read_text()
119+
assert "piwheels.org/simple" in install
120+
assert 'if [ "$ARCH" = "armv6l" ]' in install
121+
assert '--index "piwheels=https://www.piwheels.org/simple"' in install
122+
123+
117124
def test_install_script_installs_python_dev_headers():
118125
install = (REPO_ROOT / "install.sh").read_text()
119126
assert "python3-dev" in install
@@ -130,7 +137,9 @@ def test_install_script_uses_repo_python_version_for_uv():
130137
assert ".python-version" in install
131138
assert "PYTHON_REQUEST" in install
132139
assert '"$UV_BIN" venv --python "$PYTHON_REQUEST"' in install
133-
assert '"$UV_BIN" sync --directory "$CC_DIR" --python "$PYTHON_REQUEST"' in install
140+
assert '"$UV_BIN" sync \\' in install
141+
assert '--directory "$CC_DIR" \\' in install
142+
assert '--python "$PYTHON_REQUEST" \\' in install
134143

135144

136145
def test_install_script_syncs_submodule_urls():

0 commit comments

Comments
 (0)