ilanschnell/bitarray

Provide prebuilt wheels on all support os/arch/python combos

pombredanne opened this issue · 6 comments

Hi:
I am a big grateful user of bitarray with https://github.com/nexB/scancode-toolkit and I build binary wheels for many OSes for inclusion in our pre-built application bundles.
Would you care for getting a contributed GH action that would build automatically these binaries on commit? and that could also automate pushing to PyPI on tag?
You can see an example for a tool I co-maintain here https://github.com/WojciechMula/pyahocorasick/actions

Actually there is a related pending PR from @hardbyte at #87 which is a year and a half over two years old... so you may be you do not care? May be because you prefer Conda and Anaconda? If so that's fine, just tell me, I can maintain a fork to publish prebuilt wheels alright?
I guess there is already one such package at https://pypi.org/project/bitarray-hardbyte/#files and another one there https://pypi.org/project/bitarray-binary/#files ?

I am not sure this is a sane fragmentation though.

Thank you for being a grateful bitarray user and for the pointers! I personally prefer conda, and conda-forge maintains bitarray very well. I agree that the fragmentation of proejcts building wheels is a problematic. I should really take the time to set up automatic wheel building myself (maybe with your help?).

What would be the first step? I assume that I would have to activate GH actions somehow, and then some files need to be added in this repository. Which service(s) would be used to build the wheels? I'm happy to meet on Google hangout (Skype, Zoom, etc.) to learn more what exactly is involved. Thanks!

I'd recommend taking a look at https://github.com/pypa/cibuildwheel since it's maintained by the python packaging authority. I hope it takes most of the work out of it for you.

I can help you with this if you're willing @ilanschnell, I'd be overjoyed to delete my fork of bitarray! I'm happy to have a google hangout to discuss, I'm most free around 9-11am, or after 8pm NZ time. Contact is my github username at gmail dot com

I'll open a PR that uses Github actions and cibuildwheel. The github workflow will build the binary bitarray package on every git push to your repository on OSX, Windows and Ubuntu for multiple versions of Python, and package a source distribution too. All going well it will look very much like this - https://github.com/hardbyte/bitarray/actions/runs/1909431969

As you release bitarray by tagging commits, we can also have a publish step that only runs when it sees a tagged commit - this step will publish the artifacts to pypi. To enable this you'll have to add a repository secret to your github repo. Pypi lets you create a tightly scoped api token that is allowed to upload packages for just one project - https://pypi.org/manage/account/token/
You'd add that as a repo secret - in my PR called PYPI_API_TOKEN - and this can be accessed by the github actions. Note this secret won't be accessible to a pull request from a fork (like mine), so the workflow would only run for pushes to your repository.

I've set this automated publishing step up on my fork so you can see how that looks too. Here is a github action run that publishes all the artifacts - the upload logs can be found if you click on the upload_pypi job. After that ran it uploaded the corresponding files to my (hopefully soon to be deleted) fork on pypi: https://pypi.org/project/bitarray-hardbyte/2.3.8/

Note I configured that just for testing - it runs on every push instead of on a tagged commit which is why it has published 2.3.8 in my fork.

I just released bitarray 2.4.0 will all wheels on PyPI: https://pypi.org/project/bitarray/#files

@ilanschnell @hardbyte Thank you ++ ... you rock 🎸