oconnor663 / blake3-py

Python bindings for the BLAKE3 cryptographic hash function
Other
139 stars 12 forks source link

c_impl: compatibility fix for python < 3.10 #32

Closed ThomasWaldmann closed 2 years ago

ThomasWaldmann commented 2 years ago

PyModule_AddObjectRef is new in Python 3.10, so let's just use PyModule_AddObject for better compatibility.

ThomasWaldmann commented 2 years ago

I'll add testing for py38 and py39...

oconnor663 commented 2 years ago

Thank you for this, and apologies for the delay in reviewing PRs. My wife and I are moving out of our apartment this week, and it might be more like a month before I have as much free time as I'd like to catch up on my backlog.

ThomasWaldmann commented 2 years ago

Hi Jack, thanks for being here nevertheless and good luck with moving!

ThomasWaldmann commented 2 years ago

@oconnor663 i hope your move went well.

I you have some time, it would be cool if you could review the 3 small PRs of mine here.

oconnor663 commented 2 years ago

Thanks for reminding me. I've merged this, but the CI failure seems to be consistent. It looks like the SETUP_PY_DESCRIPTION constant is getting inlined in some perverse way that doesn't realize it's a string, but only under 3.8 and only on Windows. Any idea what might be causing that?

ThomasWaldmann commented 2 years ago

Guess that "double" quoting does not work like that:

"-DSETUP_PY_DESCRIPTION="experimental bindings for the BLAKE3 C implementation, API-compatible with the Rust-based blake3 module""

I am not familiar with the build, but I'ld bet it is unrelated to my changes (except that it now tests on py38 and did not before).

oconnor663 commented 2 years ago

Just added https://github.com/oconnor663/blake3-py/commit/a9c42d3899291a27495e10fb32222c4f28b10871 as a workaround.