Skip to content
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

Add support for Python 3.12 #13

Closed
ngoldbaum opened this issue Feb 5, 2024 · 0 comments · Fixed by #221
Closed

Add support for Python 3.12 #13

ngoldbaum opened this issue Feb 5, 2024 · 0 comments · Fixed by #221
Assignees
Labels
type: enhancement Issues and PRs related to improvements to existing features

Comments

@ngoldbaum
Copy link
Collaborator

ngoldbaum commented Feb 5, 2024

Describe the bug
Building csp on Python 3.12 fails due to accessing CPython internals that have been removed.

To Reproduce
Steps to reproduce the behavior:

  1. Build csp with a Python 3.12 interpreter
  2. Wait until it gets to building csp itself.
  3. Fails with the following error:
/Users/goldbaum/Documents/csp/cpp/csp/python/PyNode.cpp: In member function 'void csp::python::PyNode::init(csp::python::PyObjectPtr, csp::python::PyObjectPtr)':
/Users/goldbaum/Documents/csp/cpp/csp/python/PyNode.cpp:64:55: error: 'struct PyGenObject' has no member named 'gi_code'
   64 |     PyCodeObject * code = ( PyCodeObject * ) pygen -> gi_code;
      |                                                       ^~~~~~~

See https://github.com/python/cpython/pull/100749/files for the relevant change in CPython

Expected behavior
Build without error

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS Sonoma
  • csp main branch
@timkpaine timkpaine added the type: enhancement Issues and PRs related to improvements to existing features label Feb 5, 2024
@timkpaine timkpaine changed the title Cannot built on Python 3.12 Add support for Python 3.12 Feb 5, 2024
@robambalu robambalu self-assigned this May 6, 2024
robambalu added a commit that referenced this issue May 6, 2024
…o changes to the low level bytecode interpreter, related to how unbound variables are referenced ( commented out the test for now )

Signed-off-by: Rob Ambalu <robert.ambalu@point72.com>
robambalu added a commit that referenced this issue May 8, 2024
* resolve #13 - Python 3.12 build support. 
   * python 3.12 - fix unbound local issue - changed how ts inputs to PyNode are reset to null due to new LOAD_FAST vs LOAD_FAST_CHECK opcodes in Python 3.12.  Inject DELETE opcodes into bytecode rather than setting directly to null in c++
   * cibuildwheel 2.11.2 -> 2.16.5

Signed-off-by: Rob Ambalu <robert.ambalu@point72.com>
Carreau pushed a commit to Carreau/csp that referenced this issue May 13, 2024
* resolve Point72#13 - Python 3.12 build support. 
   * python 3.12 - fix unbound local issue - changed how ts inputs to PyNode are reset to null due to new LOAD_FAST vs LOAD_FAST_CHECK opcodes in Python 3.12.  Inject DELETE opcodes into bytecode rather than setting directly to null in c++
   * cibuildwheel 2.11.2 -> 2.16.5

Signed-off-by: Rob Ambalu <robert.ambalu@point72.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Issues and PRs related to improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants