Breaking Change: Removed obsolete/duplicate setup.py from Python.#15708
Merged
Breaking Change: Removed obsolete/duplicate setup.py from Python.#15708
setup.py from Python.#15708Conversation
This copy of `setup.py` is obsolete, as it builds the old C++ backend for Protobuf, which has been deprecated and unused since 4.21.0 when [the backend was switch to upb](https://protobuf.dev/news/2022-05-06/#python-updates). The `setup.py` that we actually distribute in our source packages is located in [`python/dist/setup.py`](https://github.com/protocolbuffers/protobuf/blob/main/python/dist/setup.py). It is not possible to build this `setup.py` directly from the GitHub repo or GitHub release tarball, because it depends on the file layout of our Python source package ([as distributed on PyPI](https://pypi.org/project/protobuf/#files)). The Python source package uses a layout that pulls together all of the things Python needs: |Python Source Package Path|GitHub Repo Path|Description| |-----|-----|-----| |`setup.py`|`python/dist/setup.py`| |`google/protobuf/*`|`python/google/protobuf/*`|pure Python sources| |`python/*`|`python/*`|C extension sources| |`utf8_range/*`|`third_party/utf8_range`|C UTF-8 Validation Library| |`upb/*`|`upb/upb/*`|C Protobuf Library| Users who want to build their own Python packages should build from our source package on PyPI, not from our GitHub repo or our GitHub release tarball. It is also possible to build our source package from GitHub using the following command (this requires Bazel): ``` $ bazel build //python/dist:source_wheel ``` PiperOrigin-RevId: 603162788
haberman
approved these changes
Feb 5, 2024
22 tasks
knedlsepp
added a commit
to knedlsepp/nixpkgs
that referenced
this pull request
May 19, 2024
In order to enable bumping the default protobuf version from protobuf_24 to protobuf_25, we address the build failure of pythonPackages.protobuf against that version. Protobuf's python package is moving away from cpp backend in favor of a µpb backend. (See: https://github.com/protocolbuffers/protobuf/tree/main/upb) The work on that seems to have lead to the introduction of a broken test in "minimal_test.py": protocolbuffers/protobuf@501ecec I suspect that this is not an issue on the nixpkgs packaging end but rather that this file is uncovered code upstream. I don't know enough about Bazel to be sure, but it looks like that file is not part of their protobuf/python/BUILD.bazel file. (I wanted to prove that in protocolbuffers/protobuf#16888 but couldn't trigger upstream's CI) So for now let's just skip that file. Note that protobuf_26.tests.pythonProtobuf is still broken. This is due to the fact that upstream removed support for building the library directly from the GitHub repo. (See: protocolbuffers/protobuf#15708) Conda packaging is also currently struggling with this: conda-forge/protobuf-feedstock#215 Related: NixOS#264902
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This copy of
setup.pyis obsolete, as it builds the old C++ backend for Protobuf, which has been deprecated and unused since 4.21.0 whenthe backend was switch to upb.
The
setup.pythat we actually distribute in our source packages is located inpython/dist/setup.py. It is not possible to build thissetup.pydirectly from the GitHub repo or GitHub release tarball, because it depends on the file layout of our Python source package (as distributed on PyPI). The Python source package uses a layout that pulls together all of the things Python needs:|Python Source Package Path|GitHub Repo Path|Description| |-----|-----|-----|
|
setup.py|python/dist/setup.py||
google/protobuf/*|python/google/protobuf/*|pure Python sources| |python/*|python/*|C extension sources||
utf8_range/*|third_party/utf8_range|C UTF-8 Validation Library| |upb/*|upb/upb/*|C Protobuf Library|Users who want to build their own Python packages should build from our source package on PyPI, not from our GitHub repo or our GitHub release tarball.
It is also possible to build our source package from GitHub using the following command (this requires Bazel):
PiperOrigin-RevId: 603162788