Skip to content

Constrain click to <8.2 for typer 0.9.x compatibility (fixes Docker install crash) - #378

Open
ndegwairungu wants to merge 1 commit into
thatmattlove:mainfrom
ndegwairungu:fix/click-typer-compat
Open

Constrain click to <8.2 for typer 0.9.x compatibility (fixes Docker install crash)#378
ndegwairungu wants to merge 1 commit into
thatmattlove:mainfrom
ndegwairungu:fix/click-typer-compat

Conversation

@ndegwairungu

Copy link
Copy Markdown

Description

Add a click>=8.1.7,<8.2 constraint to the project dependencies.

Related Issues

Motivation and Context

A fresh Docker install (git clone … && docker compose up, per the official docs) currently crashes on startup before the server ever binds:

TypeError: Secondary flag is not valid for non-boolean flag.

Root cause: the Dockerfile installs the app with pip install -e ., which resolves dependencies from pyproject.toml and ignores requirements.lock. pyproject.toml pins typer>=0.9.0 but places no constraint on click, so pip pulls click 8.2+. typer 0.9.x is incompatible with click ≥8.2 (the removal of secondary-flag support for non-boolean options), which raises the error above at CLI parse time.

CI is unaffected because the GitHub Actions workflow uses rye sync, which honors requirements.lock (already pinned to click==8.1.7) — so the break only surfaces via the Docker install path that most users follow.

Adding the constraint to pyproject.toml makes the pip install -e . path resolve a compatible click, consistent with the lockfile. (A forward-looking alternative is bumping to typer>=0.12, which supports click 8.2+, but that is a larger change; this is the minimal, lock-consistent fix.)

Tests

  • Environment: Ubuntu 24.04, Docker 29 / Compose v5, Python 3.12 (matches Unable to install on Ubuntu Ubuntu 24.04.3 LTS via Docker #348).
  • Before: fresh docker compose up → container exits 1 with the traceback above (confirmed click 8.4.2 / typer 0.9.4 resolved in the image).
  • After: with the constraint, pip install -e . resolves click 8.1.7; the container starts cleanly and serves the UI/API on :8001. Verified live queries against a MikroTik device succeed.
  • No code paths changed; rye sync / lockfile resolution is unchanged.

🤖 Generated with Claude Code

The Docker build runs `pip install -e .`, which ignores requirements.lock and
resolves click >=8.2. typer 0.9.x is incompatible with click >=8.2 and raises
"TypeError: Secondary flag is not valid for non-boolean flag" at CLI startup,
so `docker compose up` fails on a fresh Docker install (CI is unaffected
because `rye sync` uses the lockfile).

Fixes thatmattlove#341
Fixes thatmattlove#348
@ndegwairungu
ndegwairungu force-pushed the fix/click-typer-compat branch from c8fc160 to 2aadb27 Compare June 28, 2026 05:39
@WilhelmZA

WilhelmZA commented Jul 2, 2026

Copy link
Copy Markdown

have a look at #376

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.

Unable to install on Ubuntu Ubuntu 24.04.3 LTS via Docker TypeError: Secondary flag is not valid for non-boolean flag.

2 participants