Skip to content

Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 - #898

Merged
PaulAsjes merged 2 commits into
mainfrom
fix/py314-tests
Oct 17, 2026
Merged

PaulAsjes merged 2 commits into
mainfrom
fix/py314-tests

Conversation

@PaulAsjes

@PaulAsjes PaulAsjes commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Eleven tests failed when Debian packaged 2.73.0 on Python 3.14 (#897). They fail on 3.13 too. Both causes were in the tests, not the SDK. CI only ran on 3.8, so it never caught them. This fixes the tests, adds 3.13 and 3.14 to the test matrix, and bumps the version to 2.73.1 so packagers can pick up the fix.

Fixes #897

Details
  • test_flows_create_and_wait.py: Python 3.13+ strips the leading indentation from docstrings at compile time. _param_doc_entries split on "Parameters\n ----------\n" (with an 8-space indent), so the split found nothing and indexing raised IndexError. Both the generated and wrapper docstrings now go through inspect.cleandoc before splitting and comparing, which works the same on every version. The helper still finds the expected entries on 3.14 (1 for ImageClient, 4 for RunsClient), so the staleness check still works.
  • test_realtime_close_event.py: asyncio.get_event_loop() raises when no loop is set, so the run() helper now uses asyncio.run(coro).
  • CI matrix: 3.8 and 3.13 install from poetry.lock as before. 3.14 can't, because the locked pydantic-core 2.27.2 has no 3.14 wheels and its PyO3 refuses to build for anything newer than 3.13. The lock is resolved for python = "^3.8", and pydantic 2.11+ dropped 3.8, so re-locking doesn't help. pyproject.toml and poetry.lock are Fern-managed anyway. The 3.14 job runs pip install -e . plus the test deps, which picks up the latest pydantic. That's also what users and downstream packagers on 3.14 get.
  • verify_types.py hardcodes poetry run python, so it's skipped on the pip job. The Poetry jobs still run it.
  • Version bump: 2.73.0 → 2.73.1 in pyproject.toml and the User-Agent / X-Fern-SDK-Version headers in client_wrapper.py. These files are Fern-managed, but this follows the v2.49.1 hand patch bump, and the next regeneration sets its own version. .fern/metadata.json is left alone, as it was in v2.49.1.
  • fail-fast: false so one version failing doesn't hide results on the others.
  • The live API tests (which use ELEVENLABS_API_KEY) now run three times per push instead of once. If that's too much, we could pass the key only to the 3.8 job.

Testing

  • Both test files on 3.9, 3.13 and 3.14 (uv, latest deps): 29 passed each. Before the fix: 11 failed on 3.13 and 3.14.
  • Ran the CI steps locally with Poetry 1.5.1 and the lockfile on 3.13: install OK, verify_types.py OK, 245 passed. The 16 failures are live-API tests that need an API key, which I didn't have locally.
  • 3.14 with Poetry and the lockfile: pydantic-core build fails, as described above. 3.14 with the pip step: pydantic 2.14.1 / pydantic-core 2.50.1, 245 passed, the same 16 key-only failures.
  • actionlint passes on the workflow. I haven't seen the matrix run on GitHub yet; this PR's CI run is the first.

🤖 Generated with Claude Code

- Normalize docstrings with inspect.cleandoc in the create_and_wait
  signature test; Python 3.13+ strips docstring indentation at compile
  time, which broke the split on the indented "Parameters" header.
- Use asyncio.run in the realtime close event tests; get_event_loop()
  no longer creates a loop when none is set.
- Add 3.13 (poetry lockfile) and 3.14 (latest deps via pip, since the
  locked pydantic-core can't install on 3.14) to the CI test matrix.

Fixes #897

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PaulAsjes
PaulAsjes marked this pull request as ready for review October 17, 2026 09:19
@cursor

cursor Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to tests, CI workflow, and a patch version bump; no SDK runtime behavior changes beyond User-Agent version strings.

Overview
Fixes test failures on Python 3.13+ and expands CI so those versions are covered before release.

Tests: _param_doc_entries in test_flows_create_and_wait.py now normalizes docstrings with inspect.cleandoc before parsing numpydoc sections, because 3.13+ dedents docstrings at compile time and the old indented split raised IndexError. The realtime close test helper uses asyncio.run() instead of get_event_loop().run_until_complete(), which fails when no loop is set on newer Python.

CI: The test job runs a matrix on 3.8, 3.13 (Poetry + lockfile), and 3.14 (editable pip install with latest deps, since locked pydantic-core won’t build on 3.14). Type verification stays on Poetry jobs only; fail-fast: false keeps all matrix results visible.

Release: Bumps package/SDK version strings to 2.73.1 in pyproject.toml and client headers.

Reviewed by Cursor Bugbot for commit b580e5e. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PaulAsjes PaulAsjes changed the title Fix tests on Python 3.13+ and add 3.13/3.14 to CI Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 Oct 17, 2026
@PaulAsjes
PaulAsjes merged commit a8e155f into main Oct 17, 2026
6 checks passed
@PaulAsjes
PaulAsjes deleted the fix/py314-tests branch October 17, 2026 13:59
@fern-api fern-api Bot mentioned this pull request Oct 20, 2026
kraenhansen added a commit that referenced this pull request Oct 20, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (2):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@fern-api fern-api Bot mentioned this pull request Oct 27, 2026
kraenhansen added a commit that referenced this pull request Oct 27, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 2, 2026
kraenhansen added a commit that referenced this pull request Nov 4, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 6, 2026
PaulAsjes added a commit that referenced this pull request Nov 6, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Send dubbing project list fields as repeated form fields

fern-replay's patch for #825 conflicted on the new dubbing project
endpoint: it dropped the json import but left json.dumps on keyterms
and webhook_ids, breaking mypy. Finish applying the customization.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Paul Asjes <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@fern-api fern-api Bot mentioned this pull request Nov 12, 2026
kraenhansen added a commit that referenced this pull request Nov 12, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Send secondary_language_codes as repeated form fields

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 13, 2026
kraenhansen added a commit that referenced this pull request Nov 16, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Send secondary_language_codes as repeated form fields

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@fern-api fern-api Bot mentioned this pull request Nov 24, 2026
kraenhansen added a commit that referenced this pull request Nov 24, 2026
* [fern-generated] Update SDK

Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 4.64.1

* [fern-replay] Applied customizations

Patches with unresolved conflicts (3):
  - patch-560b8934: fix: send list-of-primitive multipart fields as repeated form fields (#819) (#825)
  - patch-a8e155fd: Fix tests on Python 3.13+, add 3.13/3.14 to CI, bump to 2.73.1 (#898)
  - patch-f5d53e09: Bump version to 2.74.1 (#902)
    Run `fern-replay resolve` to apply these customizations.

* Restore repeated form fields for dubbing project create

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Send secondary_language_codes as repeated form fields

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

new tests break on py3.14

2 participants