Skip to content

Add generated TUS protocol canary#114

Draft
kvz wants to merge 68 commits into
mainfrom
tus-gen
Draft

Add generated TUS protocol canary#114
kvz wants to merge 68 commits into
mainfrom
tus-gen

Conversation

@kvz
Copy link
Copy Markdown
Member

@kvz kvz commented May 26, 2026

Experimental Status

Experimental work: this PR is part of an exploratory contract/generated docs and SDK effort, and is intentionally kept as a Draft while the approach is validated.

Why

This adds the first generated island for the API2-owned TUS protocol client generator in tus-py-client. The goal is to prove the same raw TUS protocol + client feature contract can drive Python behavior without duplicating endpoint/header/status knowledge in the generator.

What

  • Add generated tusclient/protocol_generated.py with the default Tus-Resumable wire version.
  • Add generated tests/generated_protocol_contract.py with TUS wire operations, response shapes, and client feature metadata.
  • Use the generated default protocol version in BaseUploader.DEFAULT_HEADERS without changing behavior.
  • Add a real create+patch lifecycle test that drives TusClient.uploader(...).upload() from generated contract facts.
  • Fetch LFS fixtures in CI so existing fingerprint tests exercise the real sample PNG instead of its LFS pointer.

Verification

  • python -m pytest -q in a temporary venv: 48 passed, 1 LibreSSL warning from urllib3.
  • CI failure triage confirmed the generated contract test passed; the first matrix failure was existing LFS fixture checkout drift, now fixed with actions/checkout lfs: true.
  • From API2: api2/bin/cli.ts contracts tus-sdks --platform python --sdk-root ../tus-py-client --rewrite-sdk --compare-existing --no-motd

Companion PRs (tus org only)

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