jd-boyd / python-lzo

Python bindings for the LZO data compression library
GNU General Public License v2.0
74 stars 41 forks source link

Integrate cibuildwheel #75

Closed AT0myks closed 1 year ago

AT0myks commented 1 year ago

This PR adds a workflow to build and test wheels using cibuildwheel, which makes the process way easier. It replaces #65.

While testing I encountered this error for the Linux wheels because they're built on CentOS 7 which is still on lzo 2.06. For this reason I had to change setup.py so that it uses the included source files instead. This is also applied to Windows and macOS meaning it should be easier to build wheels on any platform (as long as build tools are present) because the need for external dependencies is removed. It also avoids the aforementioned issue by not relying on system-provided packages that may be of a different version.

This means that these aren't really bindings anymore since the wheels are completely standalone but they're still very small in size and I think the benefits of this approach are worth it.

We could still add an option for Linux and macOS that allows builds to be made with the headers and library files that come from package managers, for users who might want to have a linked library.

Wheels are automatically uploaded when a tag is pushed. For now they are published on TestPyPI. If you want to target the real PyPI, delete the repository-url line. You'll have to set up trusted publishing and add an environment called release (or you can rename it). This is an easy process that results in better security for the releases.

Closes #22, closes #23, closes #26, closes #48, closes #59, and closes #74 (and I think you forgot to close #54).

jd-boyd commented 1 year ago

Thank you. I will be reading this as soon as I can.

jd-boyd commented 1 year ago

Being able to build with the system liblzo is important to a lot of linux packagers, but we do still have the LZO_DIR option for them to set, so I think this is fine.