jd-boyd / python-lzo

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

Provide Windows wheels #65

Closed AT0myks closed 1 year ago

AT0myks commented 1 year ago

I don't expect this to be merged as is but maybe it can help.

This is the workflow I used to build wheels for Windows. In its current state you have to manually run it.

Some modifications could be made to build from the lzo that's included in the repo and to upload the wheels to PyPI on release.

This would close #19, #39, #49 and #55.

Also here are build instructions for Windows that could be added to the readme to close #51:

For lzo2.lib:

  1. You need cmake and msbuild
  2. Clone the repo (optional if you just want lzo2.lib and not the wheel)
  3. Download lzo and extract it, or use the one from the cloned repo
  4. At the root of the lzo directory create a build directory and cd into it
  5. Run cmake ..
  6. Run msbuild lzo_static_lib.vcxproj -p:Configuration=Release;Platform=x64
  7. lzo2.lib will be in the Release directory

For the wheel:

  1. cd to the root of the cloned repo
  2. Run set LZO_DIR=C:\path\to\dir where dir contains lzo2.lib
  3. pip install -U wheel
  4. python setup.py bdist_wheel
  5. The wheel is in the dist directory

It would be nice if you could add 1.14 wheels to PyPI for future Windows users and to avoid new issues about installation.

In the meantime wheels can be found here if someone wants them. They were built from lzo 2.10 and the repo in this state, and target CPython for Windows x64.

jd-boyd commented 1 year ago

Thank you very kindly. I'm still working on processing this, but I very much appreciate the contribution to advance an area that has historically been difficult.

AT0myks commented 1 year ago

Any update on this? Having the Windows wheels officially provided on PyPI would be nice instead of having to rely on third-party sources, and Windows users installing packages that depend on python-lzo would have one less command to type. The instructions in the readme could also be updated for those who want to build themselves. It still mentions Python 2.7 and the Microsoft link is dead.

AT0myks commented 1 year ago

Thanks for merging. Could you use the workflow to build the wheels and upload them to PyPI?