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

Python 3.12 by filmor · Pull Request #2249 · pythonnet/pythonnet

Repository navigation

Python 3.12 - #2249


Merged
filmor merged 8 commits into master from python-3.12 Oct 6, 2023
Merged

Python 3.12 #2249 filmor merged 8 commits into master from python-3.12

Conversation

filmor commented Sep 27, 2023



Copy link Copy Markdown
Member
  • Add type offsets for 3.12 and update interop generation
  • Drop unused custom incref/decref
  • Add 3.12 to CI and metadata
filmor force-pushed the python-3.12 branch 6 times, most recently from 1c0a525 to aa7426a
Compare
October 3, 2023 11:17 terencehonles mentioned this pull request Oct 3, 2023 GH-37880: [CI][Python][Packaging] Add support for Python 3.12 apache/arrow#37901 Merged filmor force-pushed the python-3.12 branch from aa7426a to 1bcf218
Compare
October 3, 2023 13:23 filmor marked this pull request as ready for review October 3, 2023 13:24

filmor commented Oct 3, 2023



Copy link Copy Markdown
Member

Author

@lostmsu Can you have a look in particular at 1bcf218 ? I'm not quite sure what exactly you are testing here but it doesn't work on 3.12 anymore.

This was referenced Oct 3, 2023 [CI][Integration] conda-integration build failures apache/arrow#37993 Closed GH-37993: [CI] Fix conda-integration build apache/arrow#37990 Merged raulcd pushed a commit to apache/arrow that referenced this pull request Oct 3, 2023 GH-37993: [CI] Fix conda-integration build (#37990) f6afc33
### Rationale for this change

The conda-integration build has recently started failing:
https://github.com/apache/arrow/actions/runs/6393852866/job/17353952453

Apparently this is because conda-forge is now providing Python 3.12 by default, and pythonnet [does not support it yet](pythonnet/pythonnet#2249).

### What changes are included in this PR?

Avoid using Python 3.12 for Archery in conda-integration build.

### Are these changes tested?

Yes, by construction.

### Are there any user-facing changes?

No.
* Closes: #37993

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>

lostmsu commented Oct 3, 2023



Copy link Copy Markdown
Member

Please take the commit from https://github.com/losttech/pythonnet/tree/instanceless-explicit to change the test. If it still does not raise in 3.12, keep the version guard and refer to python/cpython#101578

filmor force-pushed the python-3.12 branch 2 times, most recently from 53a8341 to f988251
Compare
October 3, 2023 20:21

filmor commented Oct 3, 2023



Copy link Copy Markdown
Member

Author

Same result. It actually does raise, but the reference check for PyErr fails and it doesn't convert it.

lostmsu commented Oct 3, 2023



Copy link Copy Markdown
Member

On Python 3.12 I think it should raise an instance of StopIteration. Prior to 3.12 that would be an exception with type StopIteration but without instance, which is what decoder was handling. E.g. if you replace the check for the wrapper with a check for StopIteration instance in 3.12, that should do it.

filmor added 8 commits October 4, 2023 14:21 Add type offsets for 3.12 and update interop generation 6aa92c1 Drop unused custom incref/decref 93d4119 Add 3.12 to CI and metadata 7a31d38 Update changelog d057724 Remove deprecated function call 8dfe408 For now skip over "new style" weakrefs in clear 080d1bd Ignore test-case on Python 3.12 fb49470 Python 3.12 has been released, use final version 293f8b1 filmor force-pushed the python-3.12 branch from f988251 to 293f8b1
Compare
October 4, 2023 12:36

filmor commented Oct 4, 2023



Copy link Copy Markdown
Member

Author

Well, that's not what this one is testing, though. I'll keep it deactivated for now. If the rest is fine with you, I'll merge it and cut a new version (maybe after having another look at #2245 ).

filmor merged commit 88418da into master Oct 6, 2023 filmor deleted the python-3.12 branch October 6, 2023 10:56

lostmsu commented Oct 6, 2023 · edited Loading



Copy link Copy Markdown
Member

Well, that's not what this one is testing, though.

👍I can fix the test as I outlined above. My understanding is that 3.12 always normalizes exceptions while 3.11 and before did not.

E.g. throw new PythonException(stopIteration, value: null, traceback: null) (and the original iteration over an empty list) would end up raising a Python error with type StopIteration and None value in 3.11 and before, while 3.12 will automatically call StopIteration constructor in this case and set exception value to the resulting instance.

The decoder is needed in 3.11 and before because otherwise you have no way in C# to catch None exception value.

bdirenzo-keysight mentioned this pull request Nov 13, 2023 Update to Pythonnet 3.0.3 to support Python 3.12 opentap/OpenTap.Python#131 Closed loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023 apacheGH-37993: [CI] Fix conda-integration build (apache#37990) 50b785c
### Rationale for this change

The conda-integration build has recently started failing:
https://github.com/apache/arrow/actions/runs/6393852866/job/17353952453

Apparently this is because conda-forge is now providing Python 3.12 by default, and pythonnet [does not support it yet](pythonnet/pythonnet#2249).

### What changes are included in this PR?

Avoid using Python 3.12 for Archery in conda-integration build.

### Are these changes tested?

Yes, by construction.

### Are there any user-facing changes?

No.
* Closes: apache#37993

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
AlexCatarino mentioned this pull request Jan 26, 2024 Net 9 Migration QuantConnect/Lean#7612 Closed 4 tasks done dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024 apacheGH-37993: [CI] Fix conda-integration build (apache#37990) 8091434
### Rationale for this change

The conda-integration build has recently started failing:
https://github.com/apache/arrow/actions/runs/6393852866/job/17353952453

Apparently this is because conda-forge is now providing Python 3.12 by default, and pythonnet [does not support it yet](pythonnet/pythonnet#2249).

### What changes are included in this PR?

Avoid using Python 3.12 for Archery in conda-integration build.

### Are these changes tested?

Yes, by construction.

### Are there any user-facing changes?

No.
* Closes: apache#37993

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

None yet

2 participants