Skip to content
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

Breaking Change: Removed obsolete/duplicate setup.py from Python. #15671

Merged
1 commit merged into from
Jan 31, 2024

Commits on Jan 31, 2024

  1. Breaking Change: Removed obsolete/duplicate setup.py from Python.

    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 authored and copybara-github committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    8135fca View commit details
    Browse the repository at this point in the history