Skip to content

Fix install failures from PyPI collision and systemd key misplacement - #5

Merged
timFinn merged 1 commit into
mainfrom
fix/issue-3-local-package-install
Apr 24, 2026
Merged

timFinn merged 1 commit into
mainfrom
fix/issue-3-local-package-install

Conversation

@timFinn

@timFinn timFinn commented Apr 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #3. Fresh installs via scripts/install-service.sh crashed on service start with:

ModuleNotFoundError: No module named 'weatherhat.ha_discovery'

Root cause: requirements.txt pinned weatherhat==1.0.0 from PyPI, which shadowed the local weatherhat/ package in this repo. The PyPI release lacks ha_discovery, i2c_recovery, and other modules added in this fork. Existing deployments happened to work because scripts/update.sh reinstalls the local package via pip install --no-deps . after sync — but install-service.sh never ran that step.

Changes

  • requirements.txt — removed weatherhat==1.0.0
  • scripts/install-service.sh — added pip install --no-deps "$TARGET_PROJECT" after requirements install so the local package lands in the venv
  • weatherhat.service, weatherhat-display.service — moved StartLimitBurst and StartLimitIntervalSec from [Service] to [Unit]. systemd was emitting Unknown key warnings and silently ignoring the restart-limit policy
  • README.md — added Prerequisites note with a swap-enable recipe for Pi Zero/Zero 2 W/3A+ where numpy 1.26.4 source-builds OOM on 512 MB boards

Test plan

  • Fresh clone on a Pi, run sudo ./scripts/install-service.sh, confirm service starts without ModuleNotFoundError
  • systemd-analyze verify /etc/systemd/system/weatherhat.service returns zero warnings about StartLimit*
  • journalctl -u weatherhat no longer shows Unknown key 'StartLimitIntervalSec' in section [Service], ignoring.
  • Existing deployments on Pi 4 still update cleanly via sudo ./scripts/update.sh
  • Container build (podman build) still succeeds (Containerfile was already doing pip install . after requirements, so unaffected)

…ment

requirements.txt pinned weatherhat==1.0.0 from PyPI, which shadowed the
local package in this repo and masked the ha_discovery, i2c_recovery, and
other modules added here. Fresh installs via install-service.sh ended with
ModuleNotFoundError: No module named 'weatherhat.ha_discovery' (reported
in issue #3). update.sh happened to work because it reinstalls the local
package with --no-deps after syncing.

- Drop weatherhat==1.0.0 from requirements.txt
- Install the local package in install-service.sh (matches update.sh)
- Move StartLimitBurst/StartLimitIntervalSec from [Service] to [Unit] in
  both unit files; systemd was silently ignoring them
- Document swap setup in README for Pi Zero/Zero 2 W/3A+ where numpy
  source-builds OOM on 512 MB boards

Fixes #3
@timFinn
timFinn merged commit 533aabe into main Apr 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First try, missing module, install errors.

1 participant