fix: genuinely zero-dependency core (drop runtime typing_extensions)#158
Merged
Conversation
Bare `pip install lite-bootstrap` + `import lite_bootstrap` (no extras) crashed on undeclared typing_extensions: base.py uses `typing_extensions.Self` and healthchecks_instrument.py's TypedDict is a FastAPI response model that pydantic requires be a `typing_extensions.TypedDict` on Python < 3.12 (stdlib typing.TypedDict is rejected there). So genuine zero-dependency core is not achievable while supporting 3.10/3.11 — declare typing-extensions (pure Python, free-threaded-friendly). Pre-existing (bare 1.2.3 failed identically); surfaced by a clean-room 3.14t install of published 1.3.0. Ships as 1.3.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lesnik512
force-pushed
the
fix-typing-extensions-1.3.1
branch
from
July 19, 2026 14:08
21aa0fa to
649f045
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A clean-room install of the published
1.3.0on a fresh 3.14t venv found that barepip install lite-bootstrap+import lite_bootstrap(no extras) crashes:Core uses
typing_extensionsat runtime but never declared it: aSelfreturn annotation ininstruments/base.pyand aTypedDictbase class ininstruments/healthchecks_instrument.py. Pre-existing (bare1.2.3fails identically — its only core dep wasorjson, which also doesn't pulltyping_extensions); every install with any extra masked it, because extras pulltyping_extensionsin transitively. So1.3.0's "zero-dependency core" claim was false.Fix (keeps
dependencies = []— truly zero-dep)base.py:from __future__ import annotations+TYPE_CHECKING-guardedtyping_extensionsimport (theSelfannotations become lazy; nothing resolves them at runtime — noget_type_hintsanywhere).healthchecks_instrument.py:typing_extensions.TypedDict→typing.TypedDict(in stdlib since 3.8; project requires ≥3.10; plaintotal=False, noRequired/NotRequired).Rejected declaring
typing-extensionsas a dep: removing the usage instead makes the zero-dependency promise actually true.Testing
typing_extensionspresent:import lite_bootstrap+FreeBootstrapper.bootstrap()/teardown()+HealthChecksConfig.health_check_dataall succeed.typing.TypedDictverified on real 3.10.20; the pytest matrix (3.10–3.14) re-confirms.just test215 passed, 100% coverage;just lint-ciclean (tyresolves the lazySelf).Ships as 1.3.1 (patch) — see
planning/releases/1.3.1.md.🤖 Generated with Claude Code