oconnor663 / blake3-py

Python bindings for the BLAKE3 cryptographic hash function
Other
148 stars 14 forks source link

Wheels for Python 3.11 and PyPy #27

Closed HacKanCuBa closed 2 years ago

HacKanCuBa commented 2 years ago

It would be nice to have wheels for Python 3.11 and PyPy (3.7 and 3.8), so as to not need cargo when installing blake3 in such environments.

This is a mere request, not a demand nor anything. Thanks for the good work here!.

oconnor663 commented 2 years ago

Similar issue: https://github.com/oconnor663/blake3-py/issues/28

I currently use GitHub Actions to build all the wheels. If there's an easy way to get Actions (and particularly the actions/setup-python@v2 helper that we use here) to install these versions of Python, I'd be happy to add that. According to these docs there might be:

https://github.com/actions/setup-python#available-versions-of-python https://github.com/actions/setup-python#available-versions-of-pypy

That said, if we add something like 3.11.0-alpha.3, we might want to think a bit about what our update policy is. As new alphas come out, do we expect to add them to the build "whenever"? Or is there some way to automate this? Maybe check for new Python versions persistently, like once a day, rather than tying them exclusively to versions bumps of this library? Not sure what's the most reasonable solution here.

oconnor663 commented 2 years ago

"I want to build this and upload it to PyPI for every minor CPython and PyPy version" must be something that tons of projects have to automate. How do other projects do this? Everything in this project is bespoke, which means I'm almost certainly missing something easier.

HacKanCuBa commented 2 years ago

True, I've honestly been only building wheels for linux, but most of my projects have no building deps so it doesn't make much of difference (which is why I haven't tried anything else yet). Gonna give you a hand later today

minrk commented 2 years ago

How do other projects do this?

cibuildwheel is becoming pretty standard as a way to build wheels for lots of platforms. You can see pyzmq as an example that builds wheels including a bundled (C++) library dependency, covering pypy, arm, windows, etc.

HacKanCuBa commented 2 years ago

How do other projects do this?

cibuildwheel is becoming pretty standard as a way to build wheels for lots of platforms. You can see pyzmq as an example that builds wheels including a bundled (C++) library dependency, covering pypy, arm, windows, etc.

this looks super awesome, thanks for sharing!

Pilen commented 2 years ago

Python 3.11 has been released, so it might be time to make a new release of blake3 https://discuss.python.org/t/python-3-11-0-final-is-now-available/20291

oconnor663 commented 2 years ago

Yep! The next step is getting this PR to pass CI: https://github.com/oconnor663/blake3-py/pull/37. Looks like we're still waiting for 3.11 to land for GitHub Actions macOS? https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

HacKanCuBa commented 2 years ago

ugh, yeah, seems like 3.11 isn't in macOS yet, but should be soon, i hope 🙏

oconnor663 commented 2 years ago

Wheels for 3.11 are now up.

HacKanCuBa commented 2 years ago

Wheels for 3.11 are now up.

I don't see them in the latest release :P Do you have to make a new release or can u manually push them?

oconnor663 commented 2 years ago

Oh my bad, the binaries made it to GitHub but not PyPI. Let me kick it again...

oconnor663 commented 2 years ago

Ok try now.

HacKanCuBa commented 2 years ago

hahaha awesome! I just tried in a mac and i got the wheel, and i can clearly see the rest of the wheels, so i'm closing this as fixed.

thanks so much!

oconnor663 commented 2 years ago

I guess the question of Pypy binaries is still open? But I kind of imagine anyone going out of their way to run Pypy can probably also install a Rust toolchain and let Pip build from source?

HacKanCuBa commented 2 years ago

I guess the question of Pypy binaries is still open? But I kind of imagine anyone going out of their way to run Pypy can probably also install a Rust toolchain and let Pip build from source?

You are correct, we are still missing the PyPy part :P and of course, anyone using it will know what to do regarding rust toolchain, but the same goes for CPython users. If you are planning to add PyPy as supported (meaning tests for it, i guess), and/or add it to the build chain, then i can reopen this issue (or better yet, create a new, specific one)