-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
RFE: move python bindings to separate project #12696
Comments
That is correct, the source dist is built by a Bazel rule here: https://github.com/protocolbuffers/upb/blob/main/python/dist/BUILD.bazel#L204-L227
Why are you wanting to build the Python binding from the git tree instead of using the sdist or binary wheels from PyPI? If you want to build Python packages from the repo, there are instructions here: https://github.com/protocolbuffers/protobuf/tree/main/python#building-packages-from-this-repo The Python packages do not require CMake to build.
We do not want to move Python into a separate repo. Having separate repos increases our maintenance burden, because we would have to create dependencies between the repos and it would be impossible to make atomic changes across repos.
The Python sdist does not require the C++ protobuf library. The Python packages now use upb (C) and not protobuf (C++), more info here: https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends The sdist contains the full upb library. It does not depend on the protobuf library being installed in the system image. |
This procedure is not pep517 compliant.
Because I want to have guarantee that if after release and upload to pypi new version on top of the source tree will be possible to integrate any patch added in VCS tree.
All modules should be possible to build unsing pep517 build procedure.
So how do you want to handle indeterministic build directory name used by cmake?
As long as does not match with VCS content it is kind of useless. [tkloczko@pers-jacek SPECS]$ ls -1 python-*.spec|wc -l; grep "Source:.*%{VCS}/" python-*spec |wc -l; grep "Patch:.*%{VCS}/" python-*spec |wc -l
1137
1069
603 Abome means that: in my distro I have
That approach is especially usefull and low cost obverhead when it is necessary to fix some issue which alredy has been identified and fixed in VCS and when maintainer refuses to release new module version with that fix. The same direction of the build procedures changes at the moemtn is more and more used in Fedora. |
Can you point to where this "should" language exists re: PEP 517?
I am not sure what you mean. Our Python packages do not use CMake in any way.
What is your distro? Can you point me to it so I can understand better what you are doing? If there is a way to make the repo more PEP 517 compliant without splitting it into multiple repos, we may be able to accept patches if they are not too intrusive. |
PEP stabds for Python Enhancement Proposals.
If you will look onto https://github.com/protocolbuffers/protobuf/blob/main/python/setup.py you can find hardcoded paths to the rest of the this repository source tree with which build module should be linked.
That distro still is not finished and still not publically availaible.
As I wrore if |
That It is deprecated and no longer distributed by us. It is not present in the sdist nor the binary wheels we distribute on PyPI. The implementation we now support and distribute has its setup.py here: https://github.com/protocolbuffers/upb/blob/main/python/dist/setup.py That setup.py has no requirements for anything else to be installed on the system. |
Just checked sdist tar ball from pypi and looks like its content does not match in few places to what is in git repo.
As I've pointediin comments in #12201 there are spome issue with building protobuf with its python binding from git tree because prptopbuf source tree may be configured using cmake to use off tree tree build (
cmake -B <build_directory>
).IMO it woild be better to clone protobuf to for example https://github.com/protocolbuffers/python-protobuf (to preserve python filrs changes history) and remove protobuf files than transform it to standalone build pytjon module with assumption that protobuf library and devele resources are installed in system image.
Because
protobuf
provides pkgconfig files checkingprotobuf
librarry and its devel resources presence in system image can be done usingpkgconfig
python module (https://pypi.org/project/pkgconfig/).IMO building that way
protobuf
python module will make its buil procedure fully deterministic.The text was updated successfully, but these errors were encountered: