Skip to content

test: drop FromPath so the litestar suite runs at its declared floor - #246

Merged
lesnik512 merged 1 commit into
mainfrom
fix/242-litestar-floor
Sep 20, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/242-litestar-floor

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #242.

The floor is not broken; the test was

The issue proposes raising litestar>=2.19 to the release that introduced FromPath. That would be
wrong here. Three checks:

  • FromPath appears only in tests/test_litestar_bootstrap.py, never in lite_bootstrap/.
  • It arrived in litestar 2.22.0, so raising the floor would drop 2.19, 2.20, 2.21 and 2.21.1.
  • The library bootstraps fine on litestar 2.19.0: installed at --resolution lowest-direct and
    ran LitestarBootstrapper(...).bootstrap() successfully.

The declared floor is an honest promise to users. It was a test reaching for sugar the floor does not
have, so the test changed instead. Both usages already declare the type in the route path
(/items/{item_id:int}), which makes FromPath[int] decoration rather than requirement.

One premise in the issue does not hold for this repo

right now every gate resolves highest, so no floor is ever exercised

That is the org-wide finding from modern-python/.github#107. This repo already runs a lowest-direct
job: 5 targets x 5 interpreters, installing every declared floor and bootstrapping against it with
scripts/floor_smoke.py. It passes, correctly, because the library really does work at 2.19.

What pulling the thread turned up

Running the suite at the floor surfaced 21 failures. They are not what they look like:

  • 20 also fail at newest resolution with the same installed subset. They are not floor problems;
    the test file assumes a full dev environment (fastapi, faststream, fastmcp) that litestar-all
    alone does not install.
  • 1 is genuinely floor-specific, and it is not litestar's fault. Reported separately.

Two real bugs came out of it, neither in scope here: the sentry-sdk floor crash fixed in #244 and
released as 1.9.1, and the OpenTelemetry instrumentation floor break filed separately.

Verification

At --resolution lowest-direct with litestar 2.19.0, the file now imports and collects, where before
the ImportError failed the whole module at collection. 324 tests, ruff, ty clean at current
resolution.

Test-only. No production code, no runtime behaviour, floor unchanged.

@lesnik512
lesnik512 merged commit b336947 into main Sep 20, 2026
13 checks passed
@lesnik512
lesnik512 deleted the fix/242-litestar-floor branch September 20, 2026 14:36
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.

The litestar floor installs but cannot be imported

1 participant