← Winnitude! Search  ·  Reader Mode (2239 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 250 LINKS

Python 3.14 by filmor · Pull Request #2611 · pythonnet/pythonnet

Repository navigation

Python 3.14 - #2611


Merged
filmor merged 30 commits into master from python3.14 Feb 24, 2026
Merged

Python 3.14 #2611 filmor merged 30 commits into master from python3.14

Conversation

filmor commented Aug 9, 2025 · edited Loading



Copy link Copy Markdown
Member

Main changes:

TODO:

  • Reenable all tests
  • Ensure that there are no crashes during garbage collection
  • Ensure that the meta type uses the correct (i.e.: our) tp_setattro instead of the generic one
filmor mentioned this pull request Oct 7, 2025 Add support for Python 3.14 #2610 Closed

kunom commented Oct 16, 2025 · edited Loading



Copy link Copy Markdown

Some subjective feedback from my Windows machine with VS 2022:

guywithface commented Oct 16, 2025 · edited Loading



Copy link Copy Markdown

Also had to replace the target framework from net6.0 to net8.0. Also some feedback for .net 8:

  • Add #pragma warning disable SYSLIB0011 for where BinaryFormatter is being used
  • Add <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization> to all projects
  • Remove NonCopyable from ref struct NewReference
  • Remove NonCopyable from ref struct StolenReference
  • Need to consider migrating away from using BinaryFormatter as it will be deprecated in .net9

And now getting an access memory violation for PyGC_Collect(); in Runtime.cs

ryan-kipawa mentioned this pull request Oct 20, 2025 Support for Python 3.14, and remove 3.9 DHI/mikeio1d#182 Closed 3 tasks filmor force-pushed the python3.14 branch from abbf0d7 to 9d0062f
Compare
October 22, 2025 16:59 filmor added this to the 3.1.0 milestone Oct 22, 2025

filmor commented Oct 23, 2025



Copy link Copy Markdown
Member

Author

Status report: After applying the alignment "fix" (thanks!), things work for the most part. There are some crashes in explicit garbage collection, so I have disabled those tests for now.

filmor commented Oct 24, 2025



Copy link Copy Markdown
Member

Author

Also, we currently apparently have a weird inheritance order for our meta type, which leads to it using the PyObject_GenericSetAttr instead of type_setattro, which in turn triggers assertions since python/cpython@ 5a1618a

filmor force-pushed the python3.14 branch from 3e339e3 to 2533df1
Compare
October 26, 2025 17:32

kunom commented Oct 31, 2025



Copy link Copy Markdown

@filmor As the CI seems to be pretty broken (pytest: command not found), could you please provide a list of the outstanding tasks for this PR to reach completion, as you did in the description block of the corresponding 3.13 PR .

Things not clear to me:

  • do you want to have the exluded tests re-enabled?
  • do the tests failing due to missing BinarySerializer functionality block this PR?

Thanks ;-)

filmor force-pushed the python3.14 branch from e14465b to 338dbb1
Compare
October 31, 2025 14:15

filmor commented Oct 31, 2025



Copy link Copy Markdown
Member

Author

There you go. There are still pending issues with the embedding tests that are being worked on in #2638 , but I'd be fine with releasing a wheel if we get to the point that all Python tests run through without crashes on 3.14.

This comment has been minimized.

Sign in to view filmor force-pushed the python3.14 branch from 338dbb1 to 5a93499
Compare
December 6, 2025 18:31

filmor commented Dec 7, 2025



Copy link Copy Markdown
Member

Author

This is the issue that we run into with the PyObject_GenericSetAttr usage:

filmor commented Dec 7, 2025



Copy link Copy Markdown
Member

Author

@lostmsu Please have a look. It will require quite a bit more work to get everything green again (CI-wise, in particular around the embedding), but with these changes, we should be able to release a wheel for Python 3.14.

filmor requested a review from lostmsu December 7, 2025 14:09 filmor force-pushed the python3.14 branch 2 times, most recently from 027eb12 to 7ca54ff
Compare
December 8, 2025 10:24 filmor marked this pull request as ready for review December 8, 2025 10:29 lostmsu approved these changes Dec 8, 2025
View reviewed changes

lostmsu left a comment · edited Loading



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, minor comments only.

I noticed a few files have been reformatted (whitespace only). Perhaps undo that. Technically all reformatting should be in separate commits mentioned in .git-blame-ignore-revs

filmor force-pushed the python3.14 branch 3 times, most recently from 3af5779 to 279aeea
Compare
December 9, 2025 07:08 freakboy3742 mentioned this pull request Jan 5, 2026 Briefcase doesn't work with uv beeware/briefcase#2314 Closed

This comment was marked as off-topic.

Sign in to view

This comment was marked as off-topic.

Sign in to view

This comment was marked as off-topic.

Sign in to view filmor and others added 2 commits February 16, 2026 09:20 Drop unused requirements.txt 1a1a9ab Bump astral-sh/setup-uv from 6 to 7 (#2656) 4ca65d6
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 6 to 7.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@v6...v7)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
filmor and others added 19 commits February 24, 2026 08:50 Use the actual pytest runner 96f428f Move tests that require reinit and only run on .NET Framework 5459ac7 Bump NUnit3TestAdapter from 5.2.0 to 6.0.0 (#2667) abb6855
---
updated-dependencies:
- dependency-name: NUnit3TestAdapter
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: NUnit3TestAdapter
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fix line endings 9882788 Add previous commit to ignore file dc5c6c4 Initial 3.14 commit caac33d Apply alignment fix e10d333 Disable problematic GC tests e976558 Set ht_token to NULL in Python 3.14 65af098 Fix lockfile e244503 Assign True instead of None to __clear_reentry_guard__ 8e0333d
Not at all sure why this helps, but when assigning `None` instead, the
object is gone at the time of garbage collection.
Disable the three remaining failing tests cd108b8
- The first two run into issues because our meta type's `tp_getattro` is
  not overridden by its subclasses
- The last runs into a `PyErrOccurred` when trying to access its
  `__len__`, related to our sequence decoding logic
Take the GIL in sequence and list wrappers 698bf00 Move tp_clear workaround to .NET 908e13b
In Python 3.14, the objects __dict__ seems to already be half
deconstructed, leading to crashes during garbage collection.

Since gc in Python is single-threaded (I think :)), it should
be fine to have a single static for this. If that is not true,
we can always use a thread-local instead.
Skip coreclr embedded tests for now c851b3a Workaround for blocked PyObject_GenericSetAttr in metatypes 08550d0
Python 3.14 introduced a new assertion that prevents us from using
PyObject_GenericSetAttr directly in our meta type. To work around
this, we manipulate the type dict directly.

This workaround is a simplified variant of Cython's workaround from
cython/cython#6325.

The relevant Python change is in
python/cpython#118454
Revert changes to tests f1d90f3 Bump macos image version and add arm64 a47555d Reenable .NET Core embedding tests cebfd15 filmor force-pushed the python3.14 branch from c109562 to cebfd15
Compare
February 24, 2026 07:51

filmor commented Feb 24, 2026



Copy link Copy Markdown
Member

Author

Merging as is now, will fix the CI in #2669

filmor merged commit 8cb4b35 into master Feb 24, 2026 17 of 30 checks passed filmor deleted the python3.14 branch February 24, 2026 07:55 This was referenced May 24, 2026 Bump pythonnet from 3.0.5 to 3.1.0 zcsizmadia/PyDotNet#12 Merged chore: Bump pythonnet from 3.0.5 to 3.1.0 apache/arrow-dotnet#364 Merged CurtHagenlocher pushed a commit to apache/arrow-dotnet that referenced this pull request May 25, 2026 chore: Bump pythonnet from 3.0.5 to 3.1.0 (#364) 5c6a0c9
Updated [pythonnet](https://github.com/pythonnet/pythonnet) from 3.0.5
to 3.1.0.

<details>
<summary>Release notes</summary>

_Sourced from [pythonnet's
releases](https://github.com/pythonnet/pythonnet/releases)._

## 3.1.0

## What's Changed
* ci: properly exclude job by @​RobPasMue in
pythonnet/pythonnet#2542
* `__delitem__` for `IList<T>` and `IDictionary<K,V>` by @​lostmsu in
pythonnet/pythonnet#2533
* Fix docs workflow by @​filmor in
pythonnet/pythonnet#2584
* Drop EOLd Python versions by @​filmor in
pythonnet/pythonnet#2632
* Bump setuptools and adjust license information by @​filmor in
pythonnet/pythonnet#2633
* Minimal .NET 8 usage changes by @​filmor in
pythonnet/pythonnet#2634
* Drop performance tests by @​filmor in
pythonnet/pythonnet#2636
* Properly detect availability of BinaryFormatter by @​filmor in
pythonnet/pythonnet#2639
* Use last compiler toolset version that support .NET 8 by @​filmor in
pythonnet/pythonnet#2640
* Add dependabot file by @​filmor in
pythonnet/pythonnet#2642
* Use official ARM runners by @​filmor in
pythonnet/pythonnet#2641
* Bump actions/upload-pages-artifact from 3 to 4 by @​dependabot[bot] in
pythonnet/pythonnet#2644
* Bump actions/setup-python from 2 to 6 by @​dependabot[bot] in
pythonnet/pythonnet#2646
* Bump actions/checkout from 2 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2648
* Bump actions/setup-dotnet from 1 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2645
* Use uv and derive as much as possible from the environment, if
available by @​filmor in
pythonnet/pythonnet#2652
* Fixes for the uv CI by @​filmor in
pythonnet/pythonnet#2654
* Bump astral-sh/setup-uv from 6 to 7 by @​dependabot[bot] in
pythonnet/pythonnet#2656
* Bump actions/checkout from 5 to 6 by @​dependabot[bot] in
pythonnet/pythonnet#2663
* Ensure that the tests work even if BinaryFormatter is not available by
@​filmor in pythonnet/pythonnet#2638
* Bump NUnit3TestAdapter from 5.2.0 to 6.0.0 by @​dependabot[bot] in
pythonnet/pythonnet#2667
* Fix line endings by @​filmor in
pythonnet/pythonnet#2668
* Switch to .NET SDK 10 by @​lostmsu in
pythonnet/pythonnet#2684
* Python 3.14 by @​filmor in
pythonnet/pythonnet#2611
* CI Improvements by @​filmor in
pythonnet/pythonnet#2669
* Bump System.Reflection.Emit from 4.3.0 to 4.7.0 by @​dependabot[bot]
in pythonnet/pythonnet#2694
* Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2705
* CI Improvements by @​filmor in
pythonnet/pythonnet#2707
* Fix method memleak test by @​filmor in
pythonnet/pythonnet#2708
* Bump actions/upload-pages-artifact from 4 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2709
* Update furo requirement from >=2022.9.15 to >=2025.12.19 by
@​dependabot[bot] in pythonnet/pythonnet#2711
* Move documentation deps to pyproject.toml by @​filmor in
pythonnet/pythonnet#2714
* Support .NET Framework 4.6.1 by @​Metadorius in
pythonnet/pythonnet#2701
* Fix wheel tags by @​filmor in
pythonnet/pythonnet#2716
* Name missing from __all__ on re-import by @​filmor in
pythonnet/pythonnet#2717
* Add context manager protocol for .NET IDisposable types by
@​den-run-ai in pythonnet/pythonnet#2568
* Fix MethodBinding/OverloadMapper memory leak (#​691) by
@​greateggsgreg in pythonnet/pythonnet#2719
* Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2723
* Update NUnit by @​filmor in
pythonnet/pythonnet#2724
* Silence compile-time warnings by @​filmor in
pythonnet/pythonnet#2725
* Implement support for DLR get/set by @​filmor in
pythonnet/pythonnet#2706
* Bump idna from 3.13 to 3.15 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2726

## New Contributors
* @​RobPasMue made their first contribution in
pythonnet/pythonnet#2542
* @​dependabot[bot] made their first contribution in
pythonnet/pythonnet#2644
* @​Metadorius made their first contribution in
pythonnet/pythonnet#2701

**Full Changelog**:
pythonnet/pythonnet@v3.0.5...v3.1.0

## 3.1.0-rc1

## What's Changed
* CI Improvements by @​filmor in
pythonnet/pythonnet#2669
* Bump System.Reflection.Emit from 4.3.0 to 4.7.0 by @​dependabot[bot]
in pythonnet/pythonnet#2694
* Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2705
* CI Improvements by @​filmor in
pythonnet/pythonnet#2707
* Fix method memleak test by @​filmor in
pythonnet/pythonnet#2708
* Bump actions/upload-pages-artifact from 4 to 5 by @​dependabot[bot] in
pythonnet/pythonnet#2709
* Update furo requirement from >=2022.9.15 to >=2025.12.19 by
@​dependabot[bot] in pythonnet/pythonnet#2711
* Move documentation deps to pyproject.toml by @​filmor in
pythonnet/pythonnet#2714
* Support .NET Framework 4.6.1 by @​Metadorius in
pythonnet/pythonnet#2701
* Fix wheel tags by @​filmor in
pythonnet/pythonnet#2716
* Name missing from __all__ on re-import by @​filmor in
pythonnet/pythonnet#2717
* Add context manager protocol for .NET IDisposable types by
@​den-run-ai in pythonnet/pythonnet#2568
* Fix MethodBinding/OverloadMapper memory leak (#​691) by
@​greateggsgreg in pythonnet/pythonnet#2719
* Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory by
@​dependabot[bot] in pythonnet/pythonnet#2723
* Update NUnit by @​filmor in
pythonnet/pythonnet#2724
* Silence compile-time warnings by @​filmor in
pythonnet/pythonnet#2725
* Implement support for DLR get/set by @​filmor in
pythonnet/pythonnet#2706

## New Contributors
* @​Metadorius made their first contribution in
pythonnet/pythonnet#2701

**Full Changelog**:
pythonnet/pythonnet@v3.1.0-rc0...v3.1.0-rc1

## 3.1.0-rc0

## What's Changed
* ci: properly exclude job by @​RobPasMue in
pythonnet/pythonnet#2542
* `__delitem__` for `IList<T>` and `IDictionary<K,V>` by @​lostmsu in
pythonnet/pythonnet#2533
* Fix docs workflow by @​filmor in
pythonnet/pythonnet#2584
* Drop EOLd Python versions by @​filmor in
pythonnet/pythonnet#2632
* Bump setuptools and adjust license information by @​filmor in
pythonnet/pythonnet#2633
* Minimal .NET 8 usage changes by @​filmor in
pythonnet/pythonnet#2634
* Drop performance tests by @​filmor in
pythonnet/pythonnet#2636
* Properly detect availability of BinaryFormatter by @​filmor in
pythonnet/pythonnet#2639
* Use last compiler toolset version that support .NET 8 by @​filmor in
pythonnet/pythonnet#2640
* Add dependabot file by @​filmor in
pythonnet/pythonnet#2642
* Use official ARM runners by @​filmor in
pythonnet/pythonnet#2641
* Use uv and derive as much as possible from the environment, if
available by @​filmor in
pythonnet/pythonnet#2652
* Fixes for the uv CI by @​filmor in
pythonnet/pythonnet#2654
* Ensure that the tests work even if BinaryFormatter is not available by
@​filmor in pythonnet/pythonnet#2638
* Fix line endings by @​filmor in
pythonnet/pythonnet#2668
* Switch to .NET SDK 10 by @​lostmsu in
pythonnet/pythonnet#2684
* Python 3.14 by @​filmor in
pythonnet/pythonnet#2611

## New Contributors
* @​RobPasMue made their first contribution in
pythonnet/pythonnet#2542
* @​dependabot[bot] made their first contribution in
pythonnet/pythonnet#2644

**Full Changelog**:
pythonnet/pythonnet@v3.0.5...v3.1.0-rc0

Commits viewable in [compare
view](pythonnet/pythonnet@v3.0.5...v3.1.0).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pythonnet&package-manager=nuget&previous-version=3.0.5&new-version=3.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot
Bot
mentioned this pull request May 25, 2026 🔼 NuGet: Bump pythonnet from 3.0.5 to 3.1.0 Kestrun/Kestrun#411 Open dependabot
Bot
mentioned this pull request Oct 10, 2026 Bump pythonnet from 3.0.5 to 3.2.1 baleti/revit-ballet#3 Open dependabot
Bot
mentioned this pull request Oct 28, 2026 build: Bump pythonnet from 3.0.5 to 3.2.1 akuro17/StockAnalyzer-OSS#89 Open dependabot
Bot
mentioned this pull request Nov 10, 2026 MINOR: [C#] Bump pythonnet from 3.0.4 to 3.2.1 sg-scale/arrow--apache-arrow-18.1.0#10 Open Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

6 participants