Skip to content

Nothing verifies the Python SDK on the interpreters it says it supports #107

Description

@macanderson

Problem

sdk/python/pyproject.toml declares requires-python = ">=3.9". Nothing runs
the SDK, or a typechecker over it, on 3.9, 3.10, or 3.11.

  • Every Python job in .github/workflows/ci.yml pins python-version: "3.12"
    sdk (python) is a conformant implementation, sdk (python) HTTP adapter is conformant, schema validates the examples, and the two jobs PR ci(sdk): typecheck both typed SDKs, and catch a pin that drifted from its manifest #106
    added.
  • The new sdk (python) typechecks job runs mypy --strict --python-version 3.10, not 3.9, because mypy 2.x refuses to target 3.9 at all:
    mypy: error: argument --python-version: Python 3.9 is not supported (must be 3.10 or higher). 3.10 is the nearest target it accepts, so the declared
    floor is checked by nothing.

So the package makes a support claim three interpreter versions wide that no
run has ever tested. A 3.10-only syntax or stdlib call would ship green.

How to reproduce

cd sdk/python
pip install "mypy==2.3.1"
mypy --strict --python-version 3.9 contextgraph_sdk examples   # refused outright

And there is no job in .github/workflows/ci.yml whose python-version is
anything but "3.12"rg 'python-version' .github/workflows/ci.yml.

What done looks like

Either half is a complete answer; pick one and say which in the PR.

  1. Test the claim. Add a matrix over the declared range to the two Python
    SDK jobs — python-version: ["3.9", "3.12"] at minimum, since the floor and
    the newest supported are where breakage lives — and, for the typecheck, pin
    an older mypy (1.x still targets 3.9) or switch to pyright, which does.
  2. Narrow the claim. Raise requires-python to the lowest version CI
    actually runs, and say in sdk/python/README.md what changed. This is a
    published-metadata change: it stops pip resolving the SDK for a 3.9 user, so
    it needs a version bump and a CHANGELOG.md note.

Constraints

  • sdk/typescript and sdk/go have the same shape of claim (engines.node: ">=18" against a CI pinned to "22"; go 1.x in go.mod against
    go-version: "1.22"). Whatever is decided here should be applied to those
    two in the same PR or explicitly deferred.
  • A matrix multiplies job count. The conformance jobs each build the whole Rust
    workspace first, so a naive matrix is expensive; a typecheck-only matrix is
    nearly free and may be the right first slice.

Found while adding the SDK typecheck jobs in #94 / PR #106.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Next cycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions