pybind / pybind/pybind11

What is needed to enable support for embedding pypy?

Open
#2,686 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

Our application uses pybind11 to embed Python in a large C++ application. It's working great so far (thank you!) but we've been wondering what it would take to be able to use pypy instead of cpython.

PR #774 mentions "PyPy doesn't offer any embedding support with the CPython API"

The PyPy docs almost apologetically describe its embedding API as "very minimal and a very strange" and confirm it's different than the CPython embedding API. It goes one step further and says that that API is deprecated and that PyPy should instead be embedded using the native CFFI embedding API.

So, is pybind11 + pypy + embedding a possibility but in the "haven't gotten around to it yet" category, or is it more of a "not very feasible due to wildly different approaches" thing, or something in between, or something else? If there is just too big of a gap to overcome, I'll just move on. But if it's something that might be doable that nobody has had time to work on yet, I'd love to know if you have any thoughts to share on roughly what needs to happen - maybe it's something I could tinker with.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #774 and the PyPy embedding documentation linked in the issue, including the native CFFI embedding API. Determine whether pybind11 can work with PyPy's non-CPython embedding approach and what scope support would require; the issue does not identify specific files or tests, so completion criteria are not yet defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.