Repository navigation
build(deps): declare lower bounds and test them with a lowest-direct resolution - #284
Merged
Merged
Conversation
…resolution fastapi, itsdangerous and pydantic had no lower bounds, and starlette, imported directly, was not declared at all. The session middleware needs starlette.middleware.sessions.Session, which is new in Starlette 1.0, so an unbounded install could resolve a FastAPI whose Starlette cap made the package fail at import. The new floors are the lowest versions the suite passes with on Python 3.10. A lowest tox env resolves every direct dependency, extras included, to its floor, and a Lowest dependencies workflow runs it with live servers.
This was referenced Sep 27, 2026
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
Closes #194
Part of #124.
Floors
fastapi>=0.133.0starlette)starlette>=1.0.0ImportError: cannot import name 'Session' from 'starlette.middleware.sessions'pydantic>=2.7.0pydantic>=2.7.0; 2.7.0 passesitsdangerous>=1.1.0No module named 'itsdangerous.exc'when Starlette's session module imports itpymemcache(memcached,memcache)>=4.0.0from pymemcache import HashClientfails. 3.4–3.5 construct the backend but were never run against a server, so the floor is the version all live testing has usedorjson(redis)>=3.4.7dumps/loadsredis[hiredis]>=5.3.0PyJWT>=2.9.0starletteis now declared directly because the package imports it in several modules, and the floor that matters is Starlette's own.fastapi>=0.133.0is the first FastAPI that allows Starlette 1.x.This matches reality rather than changing it.
from starlette.middleware.sessions import Sessionhas been there since 0.3.1, so an environment with an older FastAPI (and therefore Starlette < 1.0) could installfastapi-cachexand then fail at import.Annotateddependencies (AppCache,SessionDep, ...) work at every floor; the suite exercises them.Checking the floors
lowest:uv-venv-runnerwithuv_resolution = lowest-directon Python 3.10, with theredis,memcachedandjwtextras;TestClientimportshttpx; newer releases usehttpx2.lowestis not inenv_list, so a plainuv run toxis unchanged..github/workflows/lowest.yml("Lowest dependencies"):uv run tox -e lowestwith the Redis/Memcached service containers andCACHEX_REQUIRE_LIVE_SERVERS=1, so the extras' floors are checked against real servers;tox.ymland lefttest.ymlas the only version matrix; this job could later move intotest.ymlas an extra job, since its steps do not depend on the rest.docs/DEVELOPMENT.mddescribes the env (no zh-TW copy), and CLAUDE.md lists the command.Verification
uv run tox -e lowestlocally (live servers skipped): 841 passed, 190 skipped on Python 3.10.20 with fastapi 0.133.0, starlette 1.0.0, pydantic 2.7.0, itsdangerous 1.1.0, orjson 3.4.7, pymemcache 4.0.0, redis 5.3.0, PyJWT 2.9.0, httpx 0.27.0, pytest 8.3.5, pytest-asyncio 0.26.0.MemcachedBackendand rantests/backends/test_codec.py.uv run pyteston the locked versions: 841 passed, 190 skipped.uv lock --checkpasses. The lock changes only in the recorded specifiers.lowestruns in the new workflow; I did not run it locally.CHANGELOG
Changed
fastapi>=0.133.0,starlette>=1.0.0(now declared directly; the session middleware needsStarlette 1.0),
pydantic>=2.7.0anditsdangerous>=1.1.0; the extrasrequire
pymemcache>=4.0.0andorjson>=3.4.7. Older versions could beinstalled before but failed at import. A
lowesttox env and CI workflowtest every floor. (#194)