Comments (13)
Would you be open to adding a CMakeLists.txt for this project? I can prepare a PR
In a nutshell: open yes, staffed no.
The main problem is that we're not set up to accept external PRs. The reasons are purely technical. It's a fairly big project to enable the workflow needed.
But, if you're ok doing things manually for now, the process would be:
- You create a PR as usual.
- I could import it more-or-less manually into the Google environment, tweak & submit internally.
- Then the automatic service will kick in to export the change here.
I believe this could work ok for adding cmake support (assuming there will mostly or even purely be additional files; it would probably be a lot less practical for core code changes).
Let's give it a shot and see how it goes?
from pybind11_protobuf.
Edit: after downloading the header and placing it where it can be found, I get an undefined reference to an absl object when importing:
❯ python -c 'import fastproto; print(fastproto.get_person())'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: /home/maxnoe/Projects/protobuf_pybind/build/fastproto.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN4absl12lts_2021110213hash_internal15MixingHashState5kSeedE
from pybind11_protobuf.
Edit: I managed to make this work by linking against linking absl::hash absl::flat_hash_map)
, see the updated repo.
Would you be open to adding a CMakeLists.txt for this project? I can prepare a PR
from pybind11_protobuf.
Hi @maxnoe, I put together a cmake build for a project to provide bindings for some of the ignition robotics libraries. The pybind11_protobuf
branch with the cmake support is here: https://github.com/srmainwaring/pybind11_protobuf/tree/feature/cmake, but it seems that you've got it sorted in the meanwhile.
I'd also be keen to see cmake support included in the repo.
from pybind11_protobuf.
@srmainwaring Thanks! This is looking good. I see that you only include the protobuf library for the one header I also mentioned above.
I opened this issue here, to get it included in the python package: protocolbuffers/protobuf#9464
If I understand it correctly, that header should be part of the python packge and probably some utility method to get it's location.
from pybind11_protobuf.
Yes, having the headers in a place that doesn't require bringing in protobuf
directly would be good.
I used submodules to include the various dependencies, but that does present some problems (i.e. conflicts) when this package is included in larger projects, so it may be better to use cmake's find_package
for everything. The approach may also depend on what platform your using (I use macOS with brew for package management). Using find_package
does break the hermitic build that the Basel approach offers but from the standpoint of integrating with other third-party libraries that are already including a number of the same dependencies this might be an acceptable compromise.
I don't have a strong view either way, but please use any changes in my branch if they are helpful - and I'll be happy to help with testing.
from pybind11_protobuf.
A am a bit confused now. Why is this under the pybind organisation if this is still an internal google project?
from pybind11_protobuf.
from pybind11_protobuf.
Would you be open to adding a CMakeLists.txt for this project? I can prepare a PR
In a nutshell: open yes, staffed no.
The main problem is that we're not set up to accept external PRs. The reasons are purely technical. It's a fairly big project to enable the workflow needed.
But, if you're ok doing things manually for now, the process would be:
- You create a PR as usual.
- I could import it more-or-less manually into the Google environment, tweak & submit internally.
- Then the automatic service will kick in to export the change here.
I believe this could work ok for adding cmake support (assuming there will mostly or even purely be additional files; it would probably be a lot less practical for core code changes).
Let's give it a shot and see how it goes?
cc @joelynch
from pybind11_protobuf.
So it appears there's no hope for pybind11 due to protocol buffer support for python taking a drastic turn away from being able to support cmake and their new UPB thing?
from pybind11_protobuf.
So it appears there's no hope for pybind11 due to protocol buffer support for python taking a drastic turn away from being able to support cmake and their new UPB thing?
I don't understand this comment at all TBH.
Did you see that @srmainwaring contributed cmake support? Merged via #110 on Mar 9, 2023, fixes by @lopsided98 merged via #129 on Aug 25, 2023.
If that does not work for you, please provide exact details (ideally a reproducer).
from pybind11_protobuf.
@kyranf My understanding is that if you use pybind11 to create python bindings to C++ protobuf objects, you won't use the python protobuf module at all.
So them switching to upb shouldn't affect this here, correct?
from pybind11_protobuf.
So it appears there's no hope for pybind11 due to protocol buffer support for python taking a drastic turn away from being able to support cmake and their new UPB thing?
I don't understand this comment at all TBH.
Did you see that @srmainwaring contributed cmake support? Merged via #110 on Mar 9, 2023, fixes by @lopsided98 merged via #129 on Aug 25, 2023.
If that does not work for you, please provide exact details (ideally a reproducer).
if I take @srmainwaring 's gz-python project which uses pybind11 and for python to use the protobufs as a dependency, it cannot compile with cmake as it cannot find one of the headers. This is a known issue right now on that project.
from pybind11_protobuf.
Related Issues (15)
- Can I use the C++ proto message object in Python? HOT 25
- Add GHA workflow to test cmake build
- Unable to use without proto_api despite `enable_pyproto_api_setting` unset HOT 6
- Create a release package to enable adding pybind11_protobuf to Bazel Central Registry HOT 6
- No BUILD file? HOT 6
- Tests fail if protobuf is already installed in default bazel python executable HOT 2
- net/proto2/public/message.h looks like an internal include HOT 1
- Bazel build fails due to dependency that is not visible HOT 5
- Conversion not working for C++ api_implementation HOT 13
- Compiler error when integrating with `pybind11 v2.4.3` project HOT 3
- How to integrate with protobuf 3.15.3? HOT 2
- Whats the advantage of using pybind11_protobuf over just passing a serialised message string instead? HOT 2
- proto package is not preserved HOT 3
- Python 3.11 and PyFrameObject HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybind11_protobuf.