Fix package discovery so install.sh gets past step 1
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run

Adding the Flutter phone_app/ directory gave setuptools two top-level
candidates in a flat layout, so it refused to build:

    error: Multiple top-level packages discovered in a flat-layout:
    ['phone_app', 'wake_alarm']

install.sh runs under `set -euo pipefail` and does the editable install
first, so every run since has aborted at step 1 — silently skipping the
systemd units, the sleep hook, the fan script and the shutdown wrapper.
That is why /usr/local/bin/shutdown was still the pre-token-fallback
version: not a forgotten reinstall, a broken one.

Declare the build backend explicitly and restrict discovery to
wake_alarm*, so phone_app is ignored. All 9 install steps now run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-07-20 08:28:04 +02:00
parent 87d2629e88
commit d3e81174ea

View File

@ -1,13 +1,25 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[project]
name = "wake-alarm"
version = "1.0.0"
description = "Hibernate-scheduled weekend wake alarm with fan ramp and smart-plug control"
description = "Phone-driven wake alarm with fan ramp and smart-plug control"
requires-python = ">=3.10"
dependencies = [
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.1.0#subdirectory=gatelock",
"python-kasa>=0.7",
]
# Package discovery must be explicit: phone_app/ is a Flutter app, not a Python
# package, but setuptools' flat-layout autodiscovery still sees it as a second
# top-level package and refuses to build ("Multiple top-level packages
# discovered in a flat-layout"). That aborted install.sh at step 1 — which is
# how /usr/local/bin/shutdown silently went stale.
[tool.setuptools.packages.find]
include = ["wake_alarm*"]
[tool.ruff]
target-version = "py310"
include = ["*.py", "**/*.py"]