Skip to content

Add support python 3.15 - #1954

Open
p-r-a-v-i-n wants to merge 2 commits into
crossbario:masterfrom
p-r-a-v-i-n:python315
Open

p-r-a-v-i-n wants to merge 2 commits into
crossbario:masterfrom
p-r-a-v-i-n:python315

Conversation

@p-r-a-v-i-n

@p-r-a-v-i-n p-r-a-v-i-n commented Sep 27, 2026 •

Copy link
Copy Markdown

blocked until cryptography 50.0.3 or 51 ships


Description

Please explain the changes you are proposing.


Related Issue(s)

Closes or relates to #


Checklist

  • I have referenced relevant issue numbers above
  • I have performed a self-review of my code and it follows
    the style guidelines of this project
  • I have added new or used existing tests that prove my fix
    is effective or that my feature works
  • I have added necessary documentation (if appropriate) and
    updated the changelog
  • I have added an AI assistance disclosure file (required!)
    in this PR

AI Assistance Disclosure File

⚠️ Required for this PR: You MUST include a disclosure
file at .audit/<branch-name>.md right in this PR. The
disclosure file must follow the exact format and content as
described below. Your PR will not be accepted without a
disclosure file.

Example 1 file contents of your disclosure file
.audit/<branch-name>.md:

## AI Assistance Disclosure

- [ ] I did **not** use any AI-assistance tools to help create this pull request.
- [x] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.

Submitted by: @your-github-username
Date: 2026-09-27
Related issue(s): #issue-number
Branch: python315

OR

Example 2 file contents of your disclosure file
.audit/<branch-name>.md:

## AI Assistance Disclosure

- [x] I did **not** use any AI-assistance tools to help create this pull request.
- [ ] I **did** use AI-assistance tools to *help* create this pull request.
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.

Submitted by: @your-github-username
Date: YYYY-MM-DD
Related issue(s): #issue-number
Branch: branch-name

Submitting code generated primarily by AI, or for which you
cannot claim human authorship, is not permitted. See
AI Policy
for details.

Example 1 OR Example 2 show the only valid two variants. You
cannot have both or none of the first two marks checked, and you
must always have the last tick checked.

Well, "must" if you want your PR to be accepted and ultimately
merged that is. Of course you are always free to
Go ahead! Fork my Day. (TM) ;) This is Open-source.

@oberstet

oberstet commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

pls see #1963

@p-r-a-v-i-n

Copy link
Copy Markdown
Author

I would need some time to get back on this, may be till 10th oct.

@oberstet

Copy link
Copy Markdown
Contributor

rgd the CI fails: this is more likely a PyPy ABI/compatibility issue in the cryptography binary than a bug in Autobahn or Twisted. The key clue is the undefined symbol PyPy_DecRef.

Suspect Likelihood Reason
cryptography build or packaging High The failing component is its compiled Rust extension, which must link correctly against the PyPy runtime.
PyPy 3.12 runtime / ABI High The missing symbol belongs to the PyPy runtime interface. A runtime change or missing export could explain the failure.
Rust/PyO3 compatibility Plausible cryptography uses Rust, so its extension's interaction with PyPy's C API is another potential source of incompatibility.
Autobahn / Twisted Very low Neither appears to be the source of the native-extension loading error.

@p-r-a-v-i-n

Copy link
Copy Markdown
Author

should we keep the pypy312 configuration in this PR but exclude it from required CI/release targets until upstream support is available, or defer pypy312 entirely and merge only CPython 3.15?

@oberstet

Copy link
Copy Markdown
Contributor

my view: as good OSS citizens, we should track down this issue properly (is it cryptography or pypy?), and inform upstream, file an issue that reproduces the issue with minimal venv (without autobahn), and wait for upstream to fix.

until then, I don't want to introduce even more complexity into our CI just to have cpy315 and not pypy312. that's just my personal view and judgement, one might very well disagree!

but we're dealing with such stuff all the time:( call it unfortunate, call it business as usual, call it that's just how the world is;)

eg here is another example (unrelated to autobahn-python, but related to crossbar): crossbario/wamp-xbr#209

@p-r-a-v-i-n

Copy link
Copy Markdown
Author

I respect what you said and I totally agree with you and actually this how i reached here for solving similar problem in other project.

we should track down this issue properly (is it cryptography or pypy?),

I reproduced this without Autobahn or Twisted using only PyPy 3.12 and cryptography 50.0.2. The cryptography extension builds with PyO3 0.29.2, but it references old PyPy symbols such as PyPy_DecRef and PyPyExc_ValueError.
PyPy 3.12 exports the new CPython-compatible symbol names instead, so this looks like a PyO3 compatibility issue.
I reported it to PyO3 here If they confirm it is a PyPy runtime issue, I will follow up with PyPy.

@p-r-a-v-i-n

Copy link
Copy Markdown
Author

@oberstet Pyo3 closes that issue, what we should do now next ? I used AI for writing that Issue. Bcs reproducing that issue is not a brainy work, it a friction work and AI is useful to reduce this friction.

@oberstet

oberstet commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

@p-r-a-v-i-n here is my view:

  • first, don't take it personal being brushed off wrt "wall of AI text" - it depends on the audience, for an expert / project owner, the full picture with text is additional unnecessary load to process, for a 3rd party developer it might very well be useful - but then, a "3rd party" developer, user of this, might not be interested to understand those details as well. so;)
  • second, the note to first seek updated deps is very reasonable: you need to dig deeper;) two levels more. like below.

tldr

  • we need pyo3 0.29.3 - which has this fixed
  • cryptography 50.0.2 (30 Sep 2026) is at pyo3 0.29.2. The 0.29.3 bump landed one day after this release. and 50.0.1 and 50.0.0 is at pyo3 0.29.0.
  • cryptography head of master already has that
  • => we need to wait for next release of cryptography, until 50.0.3 or 51 ships

digging deeper, level 1

The fix is already released — it shipped in PyO3 0.29.3 (tagged 30 Sep 2026), not in 0.29.4. The maintainer's version number looks slightly off.

The commits that fix #6498:

  • #6389, "ci: update ffi-check for PyPy symbol mangling change" by David Hewitt. On main it is 49a9e4e3. The 0.29.3 backport is 02832a30. This is the main fix. Its newsfragment says it fixes "many unresolved symbols when linking for PyPy due to incorrect link names in pyo3-ffi". It changes every #[cfg_attr(PyPy, link_name = "PyPy…")] to #[cfg_attr(all(PyPy, not(Py_3_12)), …)], so PyPy 3.12 links against the plain CPython names (Py_DecRef, PyExc_ValueError). That includes PyPy_DecRef.
  • #6421, "check static addresses match in pyo3-ffi-check". On main it is cdd70b43, and the backport is e62a5eb3. It finishes the job for exported statics. PyExc_ValueError is exactly the symbol in your traceback, and its link name was switched here.
  • Related 0.29.3 commits: #6374 (preliminary PyPy 3.12 fixes), #6410 (raw-dylib/PyPy link names), and #6422 (functions PyPy turned into macros). #6429, which adds the PyPy 3.12 DLL to the pyo3-ffi list, is on main only.

Here is the before and after for the symbol in your traceback:

v0.29.2: #[cfg_attr(PyPy, link_name = "PyPyExc_ValueError")]
v0.29.3: #[cfg_attr(all(PyPy, not(Py_3_12)), link_name = "PyPyExc_ValueError")]

There is a release-0.29.4 branch, but it adds only three commits on top of 0.29.3: a fix for a global-allocator stack overflow, plus two CI fixes. None of them touch PyPy.

What this means for autobahn-python: your build used cryptography 50.0.2, which pulled in pyo3 0.29.2 from its lockfile. The fix is to build cryptography against pyo3 ≥ 0.29.3. You can wait for a cryptography release that bumps it, or patch its Cargo.lock for a local source build.

Sources:


digging deeper, level 2

I'll trace the pyo3 bump in cryptography's lockfile and check which tags contain it.

It isn't in any release yet. The bump is only on main.

  • The bump commit is f93d90158, "chore(deps): bump pyo3 from 0.29.2 to 0.29.3 (#15736)". It was merged on 1 Oct 2026 and is a Dependabot PR that changes only Cargo.lock.
  • Which tags contain it: none. git tag --contains f93d90158 comes back empty, and it is reachable only from origin/main.
  • What each release locks:
    • 50.0.2 (30 Sep 2026): pyo3 0.29.2. The 0.29.3 bump landed one day after this release.
    • 50.0.1 and 50.0.0: pyo3 0.29.0.

One correction to "lower floor": Cargo.toml still just says pyo3 = { version = "0.29", ... }, so the floor wasn't raised. Only the lockfile pin changed. The lockfile still matters, because the sdist ships Cargo.lock and a from-source build uses it. That's why your build compiled 0.29.2.

Until cryptography 50.0.3 or 51 ships, you have two ways to build on PyPy 3.12:

  • Build from a main checkout, which locks pyo3 0.29.3.
  • Unpack the 50.0.2 sdist, run cargo update -p pyo3 --precise 0.29.3 (this also moves pyo3-ffi, pyo3-build-config and the macros), and build from that tree. This works because 0.29.3 satisfies ^0.29.

I checked release tags in the repo rather than PyPI directly, because PyPI blocked the fetch. cryptography tags every release, so 50.0.2 should be the latest.

Sources:


@p-r-a-v-i-n

Copy link
Copy Markdown
Author

@oberstet

irst, don't take it personal being brushed off wrt "wall of AI text" - it depends on the audience, for an expert / project owner,

Thanks, I really like your attitude. Initially i thought this work is just changing the versions from previous references but it is more than that. I think I rushed in the process too much. I should have invest time in digging.

I will go through your suggestions slowly. thank you!

This branch has not been deployed

No deployments
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.

2 participants