Skip to content

Python 3.12 #2249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 6, 2023
Merged

Python 3.12 #2249

merged 8 commits into from
Oct 6, 2023

Conversation

filmor
Copy link
Member

@filmor filmor commented Sep 27, 2023

  • Add type offsets for 3.12 and update interop generation
  • Drop unused custom incref/decref
  • Add 3.12 to CI and metadata

@filmor filmor force-pushed the python-3.12 branch 6 times, most recently from 1c0a525 to aa7426a Compare October 3, 2023 11:17
@filmor filmor marked this pull request as ready for review October 3, 2023 13:24
@filmor
Copy link
Member Author

filmor commented Oct 3, 2023

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

raulcd pushed a commit to apache/arrow that referenced this pull request Oct 3, 2023
### 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
Copy link
Member

lostmsu commented Oct 3, 2023

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 filmor force-pushed the python-3.12 branch 2 times, most recently from 53a8341 to f988251 Compare October 3, 2023 20:21
@filmor
Copy link
Member Author

filmor commented Oct 3, 2023

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

@lostmsu
Copy link
Member

lostmsu commented Oct 3, 2023

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
Copy link
Member Author

filmor commented Oct 4, 2023

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 filmor merged commit 88418da into master Oct 6, 2023
@filmor filmor deleted the python-3.12 branch October 6, 2023 10:56
@lostmsu
Copy link
Member

lostmsu commented Oct 6, 2023

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.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
### 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>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
### 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>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
### 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants