From 6898d2a9d1c3e74794eea08412d1edfea222e047 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Sun, 20 Sep 2026 21:21:19 +0300 Subject: [PATCH] ci: resolve the declared dependency floors on every matrix entry --- .github/workflows/_checks.yml | 29 +++++++++++++++++++++++++++++ justfile | 2 +- pyproject.toml | 10 +++++----- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/_checks.yml b/.github/workflows/_checks.yml index 071bf08..7e32f5f 100644 --- a/.github/workflows/_checks.yml +++ b/.github/workflows/_checks.yml @@ -39,6 +39,35 @@ jobs: - run: just install - run: just test-ci + floors: + # Every other job resolves newest, so the declared floors are a claim nothing installs. + # This one resolves the bottom of each range, on every matrix entry: wheel coverage is + # per interpreter, so two interpreters resolving the same versions can still disagree + # on whether those versions install. + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + steps: + - uses: actions/checkout@v6 + - uses: astral-sh/setup-uv@v8.2.0 + with: + enable-cache: true + cache-dependency-glob: "**/pyproject.toml" + - run: uv python install ${{ matrix.python-version }} + - run: uv python pin ${{ matrix.python-version }} + # --no-build so a floor with no wheel for this interpreter fails here instead of + # quietly compiling its sdist; --no-install-project because that flag would refuse to + # build this project too, and the tests import it from the checkout. + - run: uv sync --all-extras --no-install-project --resolution lowest-direct --no-build + - run: uv run --no-sync pytest + links: runs-on: ubuntu-latest steps: diff --git a/justfile b/justfile index 1d2047f..c0a91b0 100644 --- a/justfile +++ b/justfile @@ -21,7 +21,7 @@ lint-ci: # module; rewrite it to a package-relative import so the stubs import cleanly # as tests.protos.greeter_pb2_grpc. proto: - uv run python -m grpc_tools.protoc -Itests/protos --python_out=tests/protos --grpc_python_out=tests/protos tests/protos/greeter.proto + uv run --with grpcio-tools python -m grpc_tools.protoc -Itests/protos --python_out=tests/protos --grpc_python_out=tests/protos tests/protos/greeter.proto sed -i.bak 's/^import greeter_pb2 as greeter__pb2$/from tests.protos import greeter_pb2 as greeter__pb2/' tests/protos/greeter_pb2_grpc.py rm -f tests/protos/greeter_pb2_grpc.py.bak diff --git a/pyproject.toml b/pyproject.toml index 4e0b92e..e2e2201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,10 +18,8 @@ classifiers = [ "Topic :: Software Development :: Libraries", ] dependencies = [ - # grpcio ships no cp314 wheel before 1.75.1, so a resolver picks an sdist that cannot build - # rather than reporting a conflict. - "grpcio>=1.48,<2; python_version < '3.14'", - "grpcio>=1.75.1,<2; python_version >= '3.14'", + # The committed test stubs under tests/protos refuse to import below 1.82.1. + "grpcio>=1.82.1,<2", "modern-di>=3.1,<4", ] version = "0" @@ -34,7 +32,9 @@ Issues = "https://github.com/modern-python/modern-di-grpc/issues" Changelog = "https://github.com/modern-python/modern-di-grpc/releases" [dependency-groups] -dev = ["pytest", "pytest-cov", "pytest-asyncio", "grpcio-tools", "protobuf"] +# Floored so `uv sync --resolution lowest-direct` resolves a usable harness, not each name's first release. +# grpcio-tools is not here: it pins grpcio to its own version, which would hide the floors above. +dev = ["pytest>=8", "pytest-cov>=5", "pytest-asyncio>=0.24", "protobuf>=7.35"] lint = ["ty", "ruff", "eof-fixer", "typing-extensions"] [build-system]