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

Integrate cibuildwheel #75

Merged
merged 3 commits into from
Jun 6, 2023
Merged

Integrate cibuildwheel #75

merged 3 commits into from
Jun 6, 2023

Conversation

AT0myks
Copy link
Contributor

@AT0myks AT0myks commented May 26, 2023

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

  • Upgrade setup.py to use setuptools since distutils is deprecated
  • Remove files that are already implicitly included form MANIFEST.in and add the lzo source code to the sdist
  • Move project metadata to pyproject.toml
  • Update readme to reflect changes and include build instructions

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).

@AT0myks AT0myks mentioned this pull request May 26, 2023
@jd-boyd
Copy link
Owner

jd-boyd commented May 27, 2023

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

@jd-boyd
Copy link
Owner

jd-boyd commented Jun 6, 2023

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.

@jd-boyd jd-boyd merged commit 0eafa0a into jd-boyd:main Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment