Skip to content

Python server won't start when following the README: samples main is incompatible with python-sdk main (ap2_mandate.Checkout removed in sdk #48) #118

Description

@vishkaty

Symptom

Following rest/python/server/README.md exactly on fresh clones (both repos at today's main), the database step succeeds but the server fails to start:

File ".../samples/rest/python/server/models.py", line 23, in <module>
    from ucp_sdk.models.schemas.shopping.ap2_mandate import Checkout as Ap2Checkout
ImportError: cannot import name 'Checkout' from 'ucp_sdk.models.schemas.shopping.ap2_mandate'

Since the README instructs an unpinned git clone https://github.com/Universal-Commerce-Protocol/python-sdk.git (and pyproject.toml uses an unversioned path dependency), every new contributor following the README hits this today.

Bisect

PR #48 regenerated the models for the 04-08 schemas; ap2_mandate now exports Ap2MandateExtension/Ap2WithCheckoutMandate/… and no longer has the composed Checkout that models.py L23 and integration_test.py L48 import. Verified reproducible: samples @ 827c522, sdk @ ee3a15c, macOS + uv.

Why CI didn't catch it

The samples workflows are lint/governance only — nothing builds or boot-tests the Python server against the SDK, so this class of cross-repo breakage is silent.

Suggested fixes (in order)

  1. Interim unblock: pin the SDK in the README until the migration lands — add git checkout f54858e after the clone (verified: server starts and serves with this pin).
  2. Real fix: migrate the Python server to the 04-08 SDK models (the removed class is used in models.py and integration_test.py; there's no drop-in rename, so this is part of the broader 2026-04-08 upgrade).
  3. Prevention: add a CI job that runs uv sync + boots the server (or just imports server.py) against sdk main — it would have flagged this on 2026-06-30.

Found while building an unofficial UCP conformance test suite (https://spck.dev). Happy to help with any of the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions