Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Fix compilation on python 3.10.0a7 #158

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

freundTech
Copy link
Contributor

PyArena was removed from the public api in python/cpython#25007
This commit adds two new files:

  • pycore_pyarena.h: Taken from the cpython source code with minimal
    changes
  • pyarena.h: Maps the new, underscored function names to the old
    function names, allowing the code to work on both python 3.10 and
    older versions

PyArena was removed from the public api in python/cpython#25007
This commit adds two new files:
* pycore_pyarena.h: Taken from the cpython source code with minimal
  changes
* pyarena.h: Maps the new, underscored function names to the old
  function names, allowing the code to work on both python 3.10 and
  older versions
@gvanrossum gvanrossum merged commit f3355fd into python:master Apr 6, 2021
@vstinner
Copy link
Member

vstinner commented Apr 7, 2021

Hi! I'm the author of the Python-ast.h mess: https://bugs.python.org/issue43244 :-) (move the whole API into the internal C API)

I noticed that changes will break typed-ast and I planed to offer a fix. I just got a build error when debugging packaging on Python 3.10 (packaging requires typed-ast). I was fixing the issue but... it's already fixed! Great :-) Thanks you @freundTech !!!

A few changes may land into Python 3.10: python/cpython#25252 or python/cpython#25256 (PR currently under review).

For the new Python 3.10 internal header files (pycore_asdl.h, pycore_ast.h, pycore_ast_state.h, pycore_pyarena.h), you can copy and use them in typed-ast. You just to define Py_BUILD_CORE_MODULE macro when you build your C extension.

I hesitate to request a release to get Python 3.10 support, since at least one more change may land into https://bugs.python.org/issue43244 and I don't know yet if it would affect typed-ast.

@vstinner
Copy link
Member

vstinner commented Apr 7, 2021

A few changes may land into Python 3.10: python/cpython#25252 or python/cpython#25256 (PR currently under review).

I tested python3.10 setup.py install with both PRs: none affected typed-ast, good :-)

How can I help you to release a new version including this fix?

@gvanrossum
Copy link
Member

At this point I'm the only one who can do a release and upload the wheels to PyPI (a few mypy and ex-mypy team members could too but they're also too busy). It doesn't take much effort but I am trying to reduce my computer time and it keeps falling off my todo list. Same for typing-extensions BTW. Sorry.

@gvanrossum
Copy link
Member

We now have some new helpers: Jelle Zijlstra, Shantanu Jain, and Sebastian Rittau. One of them will handle releases from now on.

@hauntsaninja
Copy link
Collaborator

Cut the 1.4.3 release including this change. I didn't build Python 3.10 wheels since it's still alpha, but the rest of the matrix of wheels should be uploaded. Let me know if you see issues.

kruton added a commit to kruton/pgesmd_self_access that referenced this pull request Dec 3, 2021
To fix compilation on Python 3.10 and newer, we need to bump typed-ast to 1.4.3 to get the fix from python/typed_ast#158.
LukeShu added a commit to emissary-ingress/emissary that referenced this pull request Sep 1, 2022
These two bumps are required for pytest to work with Python 3.10.
This doesn't matter for builds, or for in CI, but this does matter for
developers whose system Python is up-to-date.

Since Emissary 1.14 is in maintenance mode, I did the smallest
upgrades possible to get things working.

For typed-ast, that means including
python/typed_ast#158, which was first included
in 1.4.3.

For pytest, that means 6.2.5, since that's when the changelog mentions
"Python 3.10 is now supported."
https://docs.pytest.org/en/stable/changelog.html#pytest-6-2-5-2021-08-29

Signed-off-by: Luke Shumaker <[email protected]>
gjedeer added a commit to gjedeer/victron that referenced this pull request Oct 5, 2022
1.4.3 has this fix, which fixes compilation on Ubuntu 22.04 python/typed_ast#158
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants