[Python] `flatbuffers.reflection` not being packaged
Is there a reason why reflection utils for flatbuffers is not part of the official flatbuffers Python package? (we can manually download reflection.fbs from repo and regenerate Python code from schema, but it's not that convenient isn't it?)
Versions tested: v23-25
I had a quick look into this on i guess on a technical level the reason is that ./reflection/reflection.fbs is just outside of the python package directory.
Im not very familiar with the usage of the Flexbuffer / reflection.fbs setup. Can you describe how you used it?
And what would you expect to be packaged? Just the reflection.fbs or also some python files generated out of it?
For instance, I would expect something like this to work out of the box :
from flatbuffers.reflection.Schema import Schema
my_schema = Schema.GetRootAs(Path("my_schema.bfbs").read_bytes())
assert my_schema.FileIdent() == b"XXXX"
But since reflection sub-package is not exported in flatbuffers Python package, before doing something like this, we have to manually :
- download
reflection.fbsfrom this repo - run
flatcto generate corresponding Python code
It thought it would be possible right out of the box since Python code corresponding to reflection.fbs is part of the repo, but the problem is that it is not exported in Python package (misconfiguration of packaging?).