Skip to content

Modernize to build with newer Python 3 versions; improve tests#32

Merged
escherba merged 2 commits into
escherba:es/aug3from
MartyMacGyver:mff-modernize
Aug 2, 2025
Merged

Modernize to build with newer Python 3 versions; improve tests#32
escherba merged 2 commits into
escherba:es/aug3from
MartyMacGyver:mff-modernize

Conversation

@MartyMacGyver
Copy link
Copy Markdown
Contributor

@MartyMacGyver MartyMacGyver commented Jun 10, 2025

Using the int cast in the 128-bit logic causes Cython to emit
__Pyx_PyLong_From_uint64_t((__pyx_v_result.first << 64ULL))
instead of the broken
PyNumber_Lshift(__pyx_t_9, __pyx_mstate_global->__pyx_int_64L)
when we shift left a "long" int with 64ULL

Added a test that actually checks the value returned for the
128-bit hashes.

@MartyMacGyver MartyMacGyver changed the title Modernize to build with modern Python 3 versions; improve tests Modernize to build with newer Python 3 versions; improve tests Jun 10, 2025
@MartyMacGyver
Copy link
Copy Markdown
Contributor Author

This should be a more durable fix for #29 but needs more testing

Using the int cast in the 128-bit logic causes Cython to emit
__Pyx_PyLong_From_uint64_t((__pyx_v_result.first << 64ULL))
instead of the broken
PyNumber_Lshift(__pyx_t_9, __pyx_mstate_global->__pyx_int_64L)
when we shift left a "long" int with 64ULL

Added a test that actually checks the value returned for the
128-bit hashes.
@escherba escherba changed the base branch from master to es/aug3 August 2, 2025 20:21
@escherba escherba merged commit c0cd7cb into escherba:es/aug3 Aug 2, 2025
escherba added a commit that referenced this pull request Aug 2, 2025
* ci: bump actions/upload-artifact to v4
* ci: bump ubuntu os to 24.04
* add cp312 support (v0.3.4)
* ci: bump cibuildwheel to 2.23.3
* Modernize to build with newer Python 3 versions; improve tests (#32)

Using the int cast in the 128-bit logic causes Cython to emit
__Pyx_PyLong_From_uint64_t((__pyx_v_result.first << 64ULL))
instead of the broken
PyNumber_Lshift(__pyx_t_9, __pyx_mstate_global->__pyx_int_64L)
when we shift left a "long" int with 64ULL

Added a test that actually checks the value returned for the
128-bit hashes.

Co-authored-by: Eugene Scherba <escherba@gmail.com>

* add cp313 and update workflows

---------

Co-authored-by: florianvazelle <ponythugflorian@gmail.com>
Co-authored-by: Martin Falatic <martin@falatic.com>
@MartyMacGyver MartyMacGyver deleted the mff-modernize branch August 3, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants