Skip to content

deps: drop the redundant pydantic floor for 3.13 - #31

Open
lesnik512 wants to merge 1 commit into
mainfrom
deps/drop-redundant-pydantic-pin
Open

lesnik512 wants to merge 1 commit into
mainfrom
deps/drop-redundant-pydantic-pin

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Follow-up to #30. One of the four marked bounds that commit added to [project.dependencies] does not do anything. Removing it.

-"pydantic>=2.8.1; python_version == '3.13'",
 "pydantic>=2.12; python_version >= '3.14'",
 "aiohttp>=3.10.5; python_version == '3.13'",
 "aiohttp>=3.13; python_version >= '3.14'",

Why it never binds

The aiohttp>=3.10.5 marker on the same interpreter does the work. aiogram 3.2.0 pins aiohttp~=3.9.0, which that bound excludes, so the lowest aiogram the resolver can reach on 3.13 is 3.11.0 — and aiogram 3.11.0 declares pydantic>=2.4.1,<2.9. pydantic is not a direct dependency on 3.13 once this line is gone, so it resolves highest-in-range: 2.8.2, already above the 2.8.1 the line asks for.

The two bounds are not symmetric, and it is worth being precise about which is carrying the weight. Dropping each in isolation on 3.13:

removed floors resolution on 3.13
pydantic>=2.8.1 passes — aiogram 3.11.0, aiohttp 3.10.5, pydantic 2.8.2
aiohttp>=3.10.5 failsaiohttp==3.9.5 ... marked as `--no-build` but has no binary distribution
both fails, same aiohttp error

So aiohttp>=3.10.5 is load-bearing and stays. pydantic>=2.8.1 is downstream of it.

Why removing it is worth doing

This package does not import pydantic. A bound on a name you do not import is a claim you have taken on maintaining, and this one buys nothing on any path a user actually takes — a plain uv pip install 'aiogram>=3.2,<4' 'aiohttp>=3.10.5' modern-di on 3.13 resolves pydantic 2.13.5, six minor versions clear of the floor.

The one case it does affect is a user who overrides pydantic themselves, e.g. pydantic==2.4.1. Without this line that resolution is still refused, by pydantic-core's own wheel coverage:

pydantic==2.4.1 depends on pydantic-core==2.10.1 ... cannot be used
hint: Wheels are required for `pydantic-core` because building from source is disabled

The line changes which package reports that, not whether the install is possible. That is not worth narrowing every 3.13 user's pydantic range for.

Verification

Worktree off main, uv.lock deleted before each resolve — a stale lock from just install makes uv sync skip re-resolution and gives a false pass.

Floors path, uv sync --all-extras --no-install-project --resolution lowest-direct --no-build then pytest, all six matrix entries:

entry aiogram aiohttp pydantic suite
3.10 3.2.0 3.9.5 2.5.3 27 passed
3.11 3.2.0 3.9.5 2.5.3 27 passed
3.12 3.2.0 3.9.5 2.5.3 27 passed
3.13 3.11.0 3.10.5 2.8.2 27 passed
3.14 3.23.0 3.13.0 2.12.0 27 passed
3.14t 3.23.0 3.13.0 2.12.0 27 passed

Resolved-newest path unchanged: just install && just lint-ci && just test-ci — clean, 27 passed, 100% coverage. Local runs are macOS/arm64; CI is the verdict on manylinux coverage.

Not changed here

pydantic>=2.12; python_version >= '3.14' is, by the same test, also not load-bearing: dropping it leaves 3.14 and 3.14t resolving aiogram 3.23.0 and pydantic 2.12.5 anyway, again because aiohttp>=3.13 has already forced aiogram up. It predates #30 and reads as a deliberate belt-and-braces bound on the interpreter with the least wheel history, so it is left alone rather than swept up in a PR about a different line. Happy to remove it in a second pass if you want the symmetry.

The comment above the block is edited only to drop the clause describing the removed line.

`pydantic>=2.8.1; python_version == '3.13'` never binds. The `aiohttp>=3.10.5`
marker on the same interpreter already rules out aiogram 3.2, whose `aiohttp~=3.9.0`
pin is incompatible with it; the lowest aiogram that survives is 3.11.0, and it
requires `pydantic>=2.4.1,<2.9`, which resolves to 2.8.2 — above the 2.8.1 the
line asks for. Removing it changes no resolution the package's own declarations
produce.

The aiohttp markers stay: without them the floor resolution lands on aiohttp
3.9.5, which has no cp313 wheel, and the job fails. That one is load-bearing.

Verified on all six matrix entries with `uv.lock` deleted before each resolve:
the floors sync succeeds wheel-only and the suite passes 27/27. The
resolved-newest path is unchanged (`just install && just lint-ci && just test-ci`).

This branch has not been deployed

No deployments
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.

1 participant