Repository navigation
Commit 13b2f85
committed
feat!: rebuild the client as 2.0.0 against API 2.26.0
Replaces the 1.x client, generated from Swagger Codegen against a 2020-era
specification, with one regenerated from api-reference v2.26.0 through a pipeline that
reproduces from this repository alone.
123 operations, the full public surface of API 2.26.0, against 119 before. `FlatClient`
and `AsyncFlatClient`: the generator emits sync or async and never both, so
tools/generate.sh runs it twice and merges the async client under `flat_api.aio`. Typed
errors, a retry layer that understands Flat's rate limiting (HTTP 403 with the reset in
`X-RateLimit-Reset`, not 429), cursor pagination that reads the undeclared `Link` header,
`OAuth2Helper`, and a `py.typed` marker so a consumer's type checker stops ignoring the
annotations.
`SPEC_REF=v2.26.0 ./tools/generate.sh` fetches the specification by tag, runs
openapi-generator pinned to an exact 7.24.0, wipes the zone `.sdkgen.yaml` declares
generated, applies the post-generation patches and writes OPERATIONS.json. Two checks
guard it: determinism, that the same inputs twice produce identical trees, and
idempotency, that re-applying every patch changes nothing.
Packaging was broken in two ways that a green build hid. `uv build` emitted
`flat_api-0.0.0` and exited 0, because pyproject.toml still carried a `[tool.poetry]`
table under a setuptools backend, so setuptools saw no `[project]` table and fell back to
directory discovery for the name and 0.0.0 for the version; the only guard compared the
tag against `cat VERSION`, which the build never read. And the dependency list omitted
`httpx`, `aiohttp` and `aiohttp-retry`, all of which `flat_api/__init__` reaches through
its own re-exports, so a clean install could not `import flat_api` at all. It is now a
PEP 621 project with the version derived from VERSION, Apache-2.0 declared with its text,
and `requires-python >=3.11` matching the tested matrix.
The release-please workflows are removed. They published on every push to master with a
long-lived token, taking their version from release-please's manifest rather than
VERSION, which bypassed the merge gate, the tag, OIDC and provenance. Publishing is now
the tag alone: tag-on-merge.yml creates it with SDK_RELEASE_TOKEN, since GitHub does not
start a workflow run for an event created with the automatic GITHUB_TOKEN, and
release.yml uploads to PyPI by trusted publishing with attestations.
Verified: import and compileall on 3.11, 3.12 and 3.13; a clean install of the built
wheel imports FlatClient, AsyncFlatClient and OAuth2Helper; the wheel carries py.typed,
flat_api/aio/ and LICENSE and no tests or docs; 123 of 123 operations and 23 scopes with
no internal leak; 100% documentation coverage; determinism, idempotency and zone checks
pass; and all three LTI 1.3 modes deserialize to their own variant.1 parent df91280 commit 13b2f85
856 files changed
Lines changed: 95651 additions & 15447 deletions
File tree
- .github/workflows
- .openapi-generator
- docs
- reference
- flat_api
- aio
- api
- models
- api
- models
- test
- tools
- patches
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
0 commit comments