Skip to content

Drop 3.13t support - #1326

Merged
webknjaz merged 9 commits into
aio-libs:masterfrom
ngoldbaum:rm-3.13t-builds
May 11, 2026
Merged

webknjaz merged 9 commits into
aio-libs:masterfrom
ngoldbaum:rm-3.13t-builds

Conversation

@ngoldbaum

Copy link
Copy Markdown
Contributor

What do these changes do?

See the note at https://cibuildwheel.pypa.io/en/stable/changelog/#v341 and pypa/cibuildwheel#2787.

The cpython-freethreading option will be removed in the next release of cibuildwheel.

I'm going through repositories on GitHub that enable this option and sending in PRs to disable it. Happy to answer questions about this. I also took the opportunity to drop 3.13t CI.

If you're curious why 3.13t support is going away so soon, see https://py-free-threading.github.io/ci/#building-free-threaded-wheels-with-cibuildwheel for further guidance.

Are there changes in behavior for the user?

The next release will not include cp313t wheel builds.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@ngoldbaum
ngoldbaum requested a review from asvetlov as a code owner April 22, 2026 20:51
@ngoldbaum
ngoldbaum requested a review from webknjaz as a code owner April 22, 2026 20:51
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Apr 22, 2026
@codspeed

codspeed Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 245 untouched benchmarks


Comparing ngoldbaum:rm-3.13t-builds (760de41) with master (026e744)

Open in CodSpeed

@Vizonex

Vizonex commented Apr 23, 2026

Copy link
Copy Markdown
Member

@ngoldbaum Glad to see you here, seems some other people might be busy so I'll help you with the reviewing process.

@Vizonex Vizonex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this looks good might need to add a comment or two about why 3.13t is being removed but other than that I approve of this pull request.

@Vizonex Vizonex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be good enough now.

@Vizonex
Vizonex self-requested a review April 24, 2026 21:30

@Vizonex Vizonex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for feedback about the changes I let everyone on the matrix know that a workflow was left hanging.

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the change note, looks good. I'll wait for Nick and Sam to take a look before proceeding.

Comment thread CHANGES/1326.breaking.rst

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you symlink think to packaging? Also, I'm not sure if this counts as breaking.

cc @Dreamsorcerer @bdraco WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngoldbaum have you missed the symlink request?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I misunderstood what you were referring to with the symlink. See latest push.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except it looks like towncrier doesn't like symlinks, so I just removed the breaking note and called it packaging.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngoldbaum Towncrier works with symlinks just fine. This replaces having two text files with exactly the same contents 🤷‍♂️

The failure in your previous commit was caused by an HTTP 500 when uploading MyPy type preciseness coverage to Coveralls: https://github.com/aio-libs/multidict/actions/runs/25672626609/job/75361690773?pr=1326#step:8:232

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure restarting that job will make it green..

Comment thread CHANGES/1326.breaking.rst Resolved

@bdraco bdraco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once other comments are addressed. clearly 3.13t was not ready for production use so removing wheels is reasonable

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@ngoldbaum

Copy link
Copy Markdown
Contributor Author

Sorry for taking two weeks to click the button! I think this is ready now.

@codecov

codecov Bot commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.86%. Comparing base (026e744) to head (760de41).
⚠️ Report is 33 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1326   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files          28       28           
  Lines        3602     3602           
  Branches      265      265           
=======================================
  Hits         3597     3597           
  Misses          3        3           
  Partials        2        2           
Flag Coverage Δ
CI-GHA 99.86% <ø> (ø)
pytest 99.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vizonex

Vizonex commented May 9, 2026

Copy link
Copy Markdown
Member

Sorry for taking two weeks to click the button! I think this is ready now.

Good because we were worried that you just left on an hiatus, if I don't see anything new needing to be changed I'll request for this PR to be merged.

@webknjaz webknjaz mentioned this pull request May 11, 2026
3 tasks done
Comment thread CHANGES/1326.packaging.rst Outdated
@@ -0,0 +1 @@
CHANGES/1326.breaking.rst No newline at end of file

@webknjaz webknjaz May 11, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngoldbaum the problem here was that you've added a symlink relative to the repo root and so any tooling resolving it, would search for CHANGES/CHANGES/1326.packaging.rst. The correct way would be running ln -s in the CHANGES/ dir so that the relative link points to just 1326.packaging.rst w/o the dir prefix...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining, see latest commit.

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need to also have this filed under “breaking changes” (see the old symlink discussion threads inline), but this looks good to me regardless.

@webknjaz
webknjaz enabled auto-merge (squash) May 11, 2026 21:58
@webknjaz
webknjaz merged commit c4a5cae into aio-libs:master May 11, 2026
64 checks passed
bdraco added a commit to Vizonex/propcache that referenced this pull request May 17, 2026
- Remove `enable = ["cpython-freethreading"]` from `[tool.cibuildwheel]`
  in pyproject.toml (cibuildwheel 3.4 deprecated the option).
- Replace the `- 3.13t` test matrix entry with an explanatory comment
  instead of silently dropping it.
- Restructure the change note: real text lives in
  `CHANGES/223.packaging.rst`; `CHANGES/223.breaking.rst` is a symlink
  to it, mirroring the structure used in aio-libs/multidict#1326.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
asvetlov added a commit that referenced this pull request Sep 23, 2026
<!-- Thank you for your contribution! -->

## What do these changes do?

Support for free-threaded Python 3.13 was dropped in v6.8.0 (#1326),
once cibuildwheel stopped building cp313t wheels, but the C extension
kept a second free-threaded code path for interpreters without
`PyUnstable_TryIncRef()`, of which 3.13t is the only one. It was never
built in CI, never tested, and it duplicated `md_get_one()` and the
`md_contains()` dispatch outright.

`Py_GIL_DISABLED` now implies CPython 3.14 or newer. That assumption is
enforced by an `#error` in `freethreading.h`, so a free-threaded build
on 3.13t fails with a clear compiler message instead of silently
compiling an untested lock-free path (the vendored
`pythoncapi_compat.h` polyfills those calls, so it would otherwise
build). `_MD_HAVE_TRYINCREF` and every branch keyed on it are gone.

Only the C extension is affected. The pure-Python backend is
version-agnostic and unchanged, and builds with the GIL enabled still
go down to Python 3.10.

## Are there changes in behavior for the user?

No, on every supported build. The disassembly of `_multidict.so` is
identical before and after on both a free-threaded 3.14t build and a
GIL build. On an unsupported free-threaded 3.13t interpreter, building
from source now fails at compile time rather than producing an
untested extension.

## Is it a substantial burden for the maintainers to support this?

No, it removes code.

## Related issue number

None; follow-up cleanup after #1326.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist — N/A, no behaviour change; the
      existing free-threading tests cover the surviving path
- [x] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` — N/A, no such file in this repo
- [x] Add a new news fragment into the `CHANGES/` folder
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`

Drafted with Claude Code (Opus 5); reviewed by @asvetlov.

<details>
<summary>Agent run details (optional, for reviewers)</summary>

Codegen check, per build, `objdump -d` with addresses normalised,
before vs. after: identical on 3.14.7t (free-threaded) and on 3.14.2
(GIL). The only difference is the file name in the objdump header.

Tests:

- 3.14.7t, C extension: 2187 passed, 32 skipped
- 3.13.12 GIL, C extension: 2198 passed, 21 skipped
- 3.14.7t, `--no-c-extensions`: 1103 passed, 9 skipped
- 3.14.7t, `MULTIDICT_DEBUG_BUILD=1`: 2187 passed, 32 skipped

Guard behaviour:

- 3.13.7t built cleanly before this change; after it, the compile stops
  at `freethreading.h:25:2: error: #error "the free-threaded build
  requires CPython 3.14 or newer"`.
- GIL 3.13.12 still builds.

Lint: `pre-commit run --all-files` passed; `make doc-spelling` passed.

ThreadSanitizer was not run: the emitted code on 3.14t is unchanged, so
there is no new interleaving for it to exercise.

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants