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

Support pypy for python plugins #5

Open
taminob opened this issue Mar 23, 2024 · 1 comment
Open

Support pypy for python plugins #5

taminob opened this issue Mar 23, 2024 · 1 comment
Labels
enhancement New feature or request python Related to python plugin

Comments

@taminob
Copy link
Owner

taminob commented Mar 23, 2024

The current implementation of PythonPlugin relies on the features and behavior of the Python reference implementation CPython.

To be more flexible, it could be valuable to also support other interpreters like pypy.
Pypy offers a CPython compatibility layer, but unfortunately it is rather incomplete and misses some headers and functions offered in CPython, like:

  • Py_NewInterpreter()
  • #include <pytypedefs.h>
  • Py_EndInterpreter()

This issue is about replacing these and make sure that the library implementation works with pypy.

@taminob
Copy link
Owner Author

taminob commented Mar 23, 2024

The library can be compiled with pypy instead of cpython by doing the following steps:

  • Install pypy for Python3 (sudo pacman -S pypy3)
  • In src/CMakeLists.txt:
    • replace PUBLIC Python::Python by PUBLIC pypy3.10-c
    • add PUBLIC /opt/pypy3/include/pypy3.10 to the target_include_directories

These steps are Arch Linux specific, for the actual integration, a cmake/FindPypy.cmake file should be created.

@taminob taminob added enhancement New feature or request python Related to python plugin labels Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Related to python plugin
Projects
None yet
Development

No branches or pull requests

1 participant