monero-ecosystem / monero-python

A comprehensive Python module for handling Monero cryptocurrency
BSD 3-Clause "New" or "Revised" License
245 stars 79 forks source link

Replace old pysha3 with cryptodomex, test on Python 3.10 #103

Closed ghost closed 2 years ago

ghost commented 2 years ago

pysha3 is pretty old and doesn't seem to have any modern Python wheels, so it requires being compiled on Python 3.7 or newer.

Cryptodome is more modern and maintained, though larger.

emesik commented 2 years ago

Thanks for this! I wasn't aware that there was another implementation of Keccak.

I merged it into the pycryptodomex branch and added fallback to pysha3 version.

The tests are passing but I'm waiting for an answer to my question on Stack Overflow on how to allow users choosing between alternative implementations.

ghost commented 2 years ago

Thank you! That's awesome. Tests were passing locally for me as well.

From what I can tell, pycryptodomex supports Python 2.7 and 3.5+. pysha3 might go a bit older than that.

I'm not sure make the extras required or exclusive like that. It definitely gets more complicated supporting many variants. I don't think pysha3 and pycryptodomex conflict, at least.

I'm curious about how this can be done now.

ghost commented 2 years ago

Hey! I see you cut a new release with cryptodomex, but I don't think the cryptodomex code made it in.

Also, for CI, I would add black --check . here since you formatted the code with black: https://github.com/monero-ecosystem/monero-python/blob/master/.travis.yml#L19

emesik commented 2 years ago

You're right. 0.9.2 should fix everything :)

ghost commented 2 years ago

It did, thank you!!