Note: This repository contains predominantly generated code. We do not accept direct changes to generated files. Report issues on GitHub or submit fixes to the upstream OpenAPI spec in airbyte-platform.
The Python SDK is generated through a multi-step pipeline:
┌──────────────────────────────────────────┐
│ 1. Upstream OpenAPI Spec │
│ (airbyte-platform / api_sdk.yaml) │
└──────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ 2. Speakeasy Overlay (optional) │
│ (overlays/python_speakeasy.yaml) │
└──────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ 3. Speakeasy Code Generation │
│ (src/airbyte_api/) │
└──────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ 4. Post-Generation Patches │
│ (scripts/post_generate.py) │
└──────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ 5. Package Build & Publish │
│ (pyproject.toml → PyPI) │
└──────────────────────────────────────────┘
-
Upstream OpenAPI Spec — The source-of-truth API definition lives in
airbyte-platform:airbyte-api/server-api/src/main/openapi/api_sdk.yaml -
Speakeasy Overlay — Python SDK-specific customizations applied on top of the upstream spec before code generation (currently a no-op placeholder):
overlays/python_speakeasy.yaml -
Speakeasy Code Generation — Speakeasy consumes the spec (+ overlay if enabled) and generates the Python SDK in
src/airbyte_api/. These files should never be edited by hand. -
Post-Generation Patches — A Python script applies any SDK-specific patches after generation (currently a no-op placeholder):
scripts/post_generate.py -
Package Build & Publish — The generated SDK is built with
uv buildand published to PyPI via OIDC trusted publishing.
Tip: If you need to change SDK behavior, determine which layer is appropriate:
- API changes → submit to the upstream OpenAPI spec
- Python SDK-specific schema tweaks → modify the overlay
- Post-generation fixes → modify the post-generate script
- Then trigger regeneration (see below)
Use the GitHub Actions workflow: Actions > Generate SDK > Run workflow
Or comment /generate on any PR to regenerate and push results to the PR branch.
Releases use a draft-based workflow:
- The
release-drafter.ymlworkflow runs on every push to main, creating/updating a draft release - Review the draft at Releases
- Edit the draft version if needed
- Click "Publish release" — this triggers PyPI publication via OIDC
Pre-releases let you publish an SDK version for testing without making it the default on PyPI.
Two ways to trigger a pre-release:
-
Slash command on a PR (recommended for PR-based work):
/pre-release version=1.0.0rc1This builds from the PR's head branch.
-
Manual workflow dispatch (from the Actions tab):
- version (required): e.g.
1.0.0rc1,1.0.0a1. Must be valid PEP 440 with a pre-release suffix. - ref (optional, default:
main): branch, tag, or commit SHA to build from.
- version (required): e.g.
Using a pre-release:
pip install airbyte-api==1.0.0rc1When the zero-diff CI check fails, it means the committed code doesn't match what the generation pipeline produces. To debug:
-
Download the generated artifacts from the failed CI run:
gh run download <RUN_ID> --name generated_sdk_code --dir /tmp/generated_from_ci
-
Compare against committed code:
diff -rq src/ /tmp/generated_from_ci/src/
-
Fix the root cause at the appropriate layer (overlay, post-generate script, or upstream spec), then comment
/generateon the PR.
The Speakeasy CLI version is pinned in .github/speakeasy/dummy-compose.yml and bumped by Dependabot's docker-compose ecosystem. The .speakeasy/workflow.yaml uses speakeasyVersion: pinned to consume whatever version is installed.
Build tasks are defined in poe_tasks.toml and run via poethepoet:
uv run poe generate-full # Full pipeline (generate + readme + patches)
uv run poe build # Build the Python package
uv run poe lint # Run linting checks
uv run poe fix # Auto-fix lint/formatting
uv run poe test # Run tests
uv run poe typecheck # Run type checkingIf you encounter bugs or have suggestions, please open an issue. Include:
- A clear and descriptive title
- Steps to reproduce the issue
- Expected and actual behavior
- Any relevant logs or error messages
- SDK version and Python version