This is an automated email from the ASF dual-hosted git repository.
paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git
The following commit(s) were added to refs/heads/main by this push:
new 56d4e597 fix(python): Ensure source distribution builds with Cython
3.1.0 (#759)
56d4e597 is described below
commit 56d4e597385108267bed8a3f51932675da049285
Author: Dewey Dunnington <[email protected]>
AuthorDate: Fri May 30 13:00:13 2025 -0500
fix(python): Ensure source distribution builds with Cython 3.1.0 (#759)
In Cython 3.1.0, cpdef enums are no longer copied to the parent module.
We're using the types module a bit like an enum and kind of want this
behaviour, so this PR implements the workaround suggested in the Cython
docs:
https://cython.readthedocs.io/en/stable/src/userguide/language_basics.html
Closes #756, superceeds #757 as long as Will is OK with this!
---
python/src/nanoarrow/_types.pyx | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/python/src/nanoarrow/_types.pyx b/python/src/nanoarrow/_types.pyx
index e43545f2..c90dcd98 100644
--- a/python/src/nanoarrow/_types.pyx
+++ b/python/src/nanoarrow/_types.pyx
@@ -24,6 +24,11 @@ from struct import calcsize
from sys import byteorder as sys_byteorder
+# The default changed in Cython 3.1.0 such that the member of an
+# enum are no longer automatically copied to the parent module.
+globals().update(getattr(CArrowType, '__members__'))
+
+
cdef equal(int type_id1, int type_id2):
"""Check if two type identifiers are equal