From d3e81174ea0d6cfcd27c2683af11e91d81782c85 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 20 Jul 2026 08:28:04 +0200 Subject: [PATCH] Fix package discovery so install.sh gets past step 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- pyproject.toml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 98b91a7..c830f45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]