Martinsos / edlib

Lightweight, super fast C/C++ (& Python) library for sequence alignment using edit (Levenshtein) distance.
http://martinsos.github.io/edlib
MIT License
493 stars 162 forks source link

Python Wheels #160

Closed cjw85 closed 3 years ago

cjw85 commented 3 years ago

A first attempt to get travis to build python wheels with the help of https://github.com/joerick/cibuildwheel.

The previous job scripting has been moved to a yaml anchor to allow the use of two CI stages:

TODO: the scripting for cibuildwheels needs some work to take account of what goes on in bindings/python/Makefile before python setup.py ... is called.

Martinsos commented 3 years ago

Hi @cjw85 , thanks for making the PR, this is great :)! It will take me a day or few to give this a proper look, but I am excited to review it. What about the TODO that you left: Is that something you plan to yet handle, or is that something you are expecting somebody else to handle? Should I review immediatelly, or would you like me to wait until you get the TODO done?

cjw85 commented 3 years ago

I did this last night thinking it would be just a case of refactoring the travis file. That's done. There's more work to do now that I didn't anticipate, to get the wheel actually built inside the docker containers that cibuildwheel will run. One way to do this would be to move the logic of the Makefile into the setup.py script. Maybe simply shell out to make. It sounds a bit nasty; the alternative is to dig through the docs of cibuildwheel to find how to make it run a script before running setup.py.

I'll try to do this if I get a chance, it won't be immediately though.

Martinsos commented 3 years ago

@cjw85 ok no hurry, I will try to pitch in as soon as I catch some time to look at this from close up!

cjw85 commented 3 years ago

I think I'm almost there. Just fighting travis

cjw85 commented 3 years ago

@Martinsos

I think this is good now. Your library builds are all as before.

The additional cibuildwheel builds create wheels for python3.5-3.9 for both linux and mac. The wheels get tested by running your test.py script as was being done before by installing the source distribution. Both the wheels and sdist will get uploaded to PyPI when you make a tag provided you give travis your PyPI API key (and fill in your username in the .travis file)

cjw85 commented 3 years ago

I'm done making edits here. I think I've amended everything you noted.

cjw85 commented 3 years ago

All done (provided I didn't make typos).

Martinsos commented 3 years ago

@cjw85 alrgith, I think this is it then! Give me a couple of days to find some time to give this a thorough final look, and then I will merge and possibly do some polishing if I think there are some small details still left to take care of.