GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python 3.12 by filmor · Pull Request #2249 · pythonnet/pythonnet

Conversation

@filmor

@filmor 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@filmor
filmor force-pushed the python-3.12 branch 6 times, most recently from 1c0a525 to aa7426a Compare October 3, 2023 11:17
@terencehonles terencehonles mentioned this pull request Oct 3, 2023
GH-37880: [CI][Python][Packaging] Add support for Python 3.12 apache/arrow#37901
Merged
@filmor
filmor force-pushed the python-3.12 branch from aa7426a to 1bcf218 Compare October 3, 2023 13:23
@filmor
filmor marked this pull request as ready for review October 3, 2023 13:24
@filmor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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
@pitrou
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 <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
@lostmsu

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lostmsu

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

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).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

lostmsu commented Oct 6, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bdirenzo-keysight 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
@pitrou @loicalleyne
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 <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
@AlexCatarino 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
@pitrou @dgreiss
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 <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@filmor @lostmsu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.