-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
python 3.11 support #11031
Comments
That is true, we should update setup.py to be more clear about supporting Python 3.11.
It looks like you are trying to build the old extension. The code in https://github.com/protocolbuffers/protobuf/tree/main/python/google/protobuf/pyext is deprecated in OSS and is no longer used in our official releases. If you install binary wheels from our PyPI packages, it should support 3.11 without you needing to compile anything. That said, we should make it easier to build from source when necessary. Our source packages appear to contain the old extension code. We should update that to contain the new extension from https://github.com/protocolbuffers/upb/tree/main/python instead. |
Hi! |
No, protobuf uses the Python Limited API where possible. Any packages that have So Ideally we would have used |
pkgsrc is a source-based distribution and we build nearly everything from source, so I'd appreciate it if the appropriate sources were available with protobuf releases. |
Hi! |
@Visone-Selektah pkgsrc has support for using wheel files; basically the wheel module is used to install them, and then a pkgsrc binary package is created from that. |
Thanks so much!! |
Use the binary wheel for now; upstream includes old sources in the source distribution that do not support python 3.11 but the binary wheels are built from sources that do. protocolbuffers/protobuf#11031 (comment) Comments: - Should we generally switch to the binary wheel for now? We might want to use the new sources for other python versions as well. - This increases pkglint output for this package a lot, but since is hopefully a temporary measure, I didn't put more effort into deduplicating the PLIST
@esorot I would like to keep this open until the source distribution has the up-to-date sources. Or should I file a new bug report for that? |
Hi Josh, |
It is a goal to offer something like this, but we are in the early stages. There have been some experiments for wrapping upb in a high-level C++ API (see https://github.com/protocolbuffers/upb/tree/main/protos and https://github.com/protocolbuffers/upb/tree/main/protos_generator), but this API is immature and subject to change. At the Python level, we do not yet expose a capsule API like |
Thanks for the pointers Josh. |
So following up on this attempt: pybind11_protobuf also fails with 3.11 if you turn on the optional |
More following up... I had a look a the upb/protos and upb/protos_generator. This appears to be purely an alternative C++ API. The upb/python directory looks completely disjoint with it and generates an equivalent of the protobuf Python binding (I'm quite impressed that you're sourcing and passing the vast majority of their tests). So correct me if I'm wrong, just so I understand, the only way to a "Python wrappers on C or C++ instances of protobufs with no serialization cost at the cross-language layer" is via
In the meantime I have no choice but to eat up the cost of serialization/deserialization. (And pybind11_protobuf does not support use_fast_cpp_protos from 3.11 and after, so that doesn't provide a solution either.) |
What language does this apply to?
This is for the python protobuf support
Describe the problem you are trying to solve.
Please provide python 3.11 support for protobuf.
I found
#10836 (comment)
where it says "... our newest release supports Python 3.11."
but setup.py and tox.ini do not mention python 3.11, and when I tried building 21.9 with python 3.11.0 (from pkgsrc), I see
Describe the solution you'd like
Building protobuf works with python 3.11.
The text was updated successfully, but these errors were encountered: