[PR #1206] python - build abi3 wheels in cibuildwheel #1769

Open
opened 2026-01-29 20:55:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/1206
Author: @K0lb3
Created: 10/5/2024
Status: 🔄 Open

Base: masterHead: add-python-abi3


📝 Commits (9)

  • ed80eaf refractor(python): move bro and brotli from python to python/brotli
  • f27ffcc refractor(python): rename brotli.py to init.py
  • 0aba39c refractor(python): rename bro to main.py
  • 1eb0693 feat(python): _brotli.c - implement optional abi3 wheel build
  • 874a045 feat(python): add type stubs
  • 8c5c5ac chore(python): update MANIFEST.in
  • 4f9217f feat(python): make setup.py conditional abi3 compatible, and python2 compatible again
  • 8a33569 chore(python): add comments to conditional preprocessor branches, use Py_LIMITED_API_PRE_11
  • f582691 chore(python): change copyright year to 2025

📊 Changes

9 files changed (+426 additions, -161 deletions)

View changed files

📝 MANIFEST.in (+5 -3)
📝 python/_brotli.c (+144 -29)
python/brotli.py (+0 -57)
python/brotli/__init__.py (+32 -0)
python/brotli/__init__.pyi (+201 -0)
📝 python/brotli/__main__.py (+0 -0)
python/brotli/py.typed (+0 -0)
📝 python/tests/_test_utils.py (+1 -1)
📝 setup.py (+43 -71)

📄 Description

This PR makes it possible to build abi3 wheels within a cibuildwheel environment.
To not effect the performance of version specific builds the C code changes are all guarded within preprocessor conditions.

This PR also modifies the setup.py, making it:

  • abi3 compatible
  • python 2 compatible again
  • simplifies the extension build code a bit

TODO:

  • add type stubs (currently don't get included in wheel)
  • fix abi3 setup.py build issue (C code works, setup.py still has some issues)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/1206 **Author:** [@K0lb3](https://github.com/K0lb3) **Created:** 10/5/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `add-python-abi3` --- ### 📝 Commits (9) - [`ed80eaf`](https://github.com/google/brotli/commit/ed80eaf12295da14deba7761bbec58c26a15e8e9) refractor(python): move bro and brotli from python to python/brotli - [`f27ffcc`](https://github.com/google/brotli/commit/f27ffccc1ca360d4a4957761264c4f2b8e1ec343) refractor(python): rename brotli.py to __init__.py - [`0aba39c`](https://github.com/google/brotli/commit/0aba39cd3004174b1a05b85e0cd9fd032fc3fdf7) refractor(python): rename bro to __main__.py - [`1eb0693`](https://github.com/google/brotli/commit/1eb06930b8414aae51cb37ead8a475673ddd35b7) feat(python): _brotli.c - implement optional abi3 wheel build - [`874a045`](https://github.com/google/brotli/commit/874a04507f03164b888f582b59498df83ef62c71) feat(python): add type stubs - [`8c5c5ac`](https://github.com/google/brotli/commit/8c5c5ac7285fefcc2c757da3a6f32a0dae39fab5) chore(python): update MANIFEST.in - [`4f9217f`](https://github.com/google/brotli/commit/4f9217fd7f217b2c3612b9bbc54f00cf7669a2df) feat(python): make setup.py conditional abi3 compatible, and python2 compatible again - [`8a33569`](https://github.com/google/brotli/commit/8a335695f6c174aa5fcb43726f3395e4236afad6) chore(python): add comments to conditional preprocessor branches, use Py_LIMITED_API_PRE_11 - [`f582691`](https://github.com/google/brotli/commit/f5826910738a8abbb43d7108cbf54db806467667) chore(python): change copyright year to 2025 ### 📊 Changes **9 files changed** (+426 additions, -161 deletions) <details> <summary>View changed files</summary> 📝 `MANIFEST.in` (+5 -3) 📝 `python/_brotli.c` (+144 -29) ➖ `python/brotli.py` (+0 -57) ➕ `python/brotli/__init__.py` (+32 -0) ➕ `python/brotli/__init__.pyi` (+201 -0) 📝 `python/brotli/__main__.py` (+0 -0) ➕ `python/brotli/py.typed` (+0 -0) 📝 `python/tests/_test_utils.py` (+1 -1) 📝 `setup.py` (+43 -71) </details> ### 📄 Description This PR makes it possible to build abi3 wheels within a cibuildwheel environment. To not effect the performance of version specific builds the C code changes are all guarded within preprocessor conditions. This PR also modifies the setup.py, making it: - abi3 compatible - python 2 compatible again - simplifies the extension build code a bit TODO: - [x] add type stubs (currently don't get included in wheel) - [x] fix abi3 setup.py build issue (C code works, setup.py still has some issues) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:55:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#1769