Skip to content

ci: resolve the declared dependency floors on every matrix entry - #28

Open
lesnik512 wants to merge 1 commit into
mainfrom
ci/floors-gate
Open

lesnik512 wants to merge 1 commit into
mainfrom
ci/floors-gate

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Adds the floors job the org standard requires (standard.md §7), following modern-di-fastapi#56. This repo needed three changes before the job could tell the truth.

1. grpcio-tools was hiding the floor

grpcio-tools pins grpcio to its own version, so any bound on it in [dependency-groups] silently drags the runtime floor up with it and the job reports a version it never tested. It is also not a test dependency — nothing under tests/ imports it. Its only user is the proto recipe, which now pulls it on demand:

uv run --with grpcio-tools python -m grpc_tools.protoc ...

Verified by running just proto: it regenerates the stubs as before.

2. The declared floor was unreachable

With grpcio-tools out of the way, the floor installed and the suite failed on every interpreter:

RuntimeError: The grpc package installed is at version 1.75.1, but the generated
code in greeter_pb2_grpc.py depends on grpcio>=1.82.1.

The committed stubs under tests/protos carry GRPC_GENERATED_VERSION = '1.82.1' and refuse to import below it. grpcio>=1.48 was not a claim this repo could stand behind — nothing here has ever run against it, and the pytest matrix could not notice because it resolves newest.

grpcio 1.82.1 ships cp310 through cp314 wheels, so the floor is now flat and the per-interpreter markers are gone:

"grpcio>=1.82.1,<2",

Worth knowing for later: running just proto raises this floor as a side effect. The regenerated stubs come out at whatever grpcio-tools is current — 1.84.0 today — and the floor has to move with them.

Wheel coverage would have forced markers anyway if the stubs had allowed a lower floor: grpcio's first wheel is 1.41.0 for cp310, 1.49.0 for cp311, 1.59.0 for cp312, 1.66.2 for cp313, 1.75.1 for cp314. The old two-line marker covered only the last of those.

3. protobuf is floored at the gencode version

The committed gencode is Protobuf Python 7.35.0 and validates the runtime's major and minor at import, so protobuf>=7.35.

Why the job exists

pytest resolves every dependency at its newest, so the bottom of each declared range ships unexercised. This job resolves direct dependencies at their floors, wheel-only, on every entry of the same matrix pytest uses, and runs the suite against them.

--no-build: a floor reachable only by compiling an sdist is not a floor a user installing a wheel can reach — which matters more than usual here, since grpcio has no pure-python fallback and its sdist needs a C toolchain. --no-install-project is mandatory alongside it — --no-build would otherwise refuse to build this project too, and the tests import it from the checkout.

The matrix is the repo's own five entries; 3.14t stays out, per the exemption already recorded in the standard.

Verification

Run locally on all five interpreters at the floors: grpcio==1.82.1, protobuf==7.35.0, 37 passed on each. Resolved-newest path re-checked with just install && just lint-ci && just test-ci, and just proto re-run to confirm the recipe still works. Local runs are macOS/arm64; CI is the verdict on manylinux wheel coverage.

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