In updating one of my development environments, I discovered that Cython has released version 3.0 after our 2.0.1.post1 release. This exposes a few issues (none of which are fatal) with our implementation:
While we were getting a warning about using a deprecated NumPy API under Cython 0.29, Cython 3.0 now makes it possible to remove the warning. Use the migration guide to update the build appropriately.
.../lib/python3.11/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
It appears that Cython 3.0 deprecated the "DEF" statement (cython/cython#4310). This affects the sbdf.pyx module, but only for the static constants used to process dates, times, and decimal values. Refactor this usage to avoid triggering the (currently) warning.
warning: spotfire/sbdf.pyx:82:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: spotfire/sbdf.pyx:83:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: spotfire/sbdf.pyx:84:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
warning: spotfire/sbdf.pyx:103:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See https://github.com/cython/cython/issues/4310
Along with the "DEF" statement, the "IF" statement used to conditionalize the platform-specific code in codesign.pyx and cabfile.pyx is now deprecated also. Since the recommended options don't work well for platform-specific code, we need to refactor these modules so that the platform-specific code is in separate files and the conditionality is moved into the setup.py script (making sure to remove the current logic that excludes the generated C files from the distribution and the cython_c_in_temp flag on the Extension objects).
warning: spotfire/cabfile.pyx:11:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
warning: spotfire/codesign.pyx:10:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
It appears that Cython 3.0 has updated exception handling propagation for cdef functions declared without except clauses. While this should automatically fix part of #44, we should check other uses and either move to using the new "noexcept" clause where exceptions should not be propagated, or remove places where we explicitly added "except *" clauses to force propagation.
Fix these issues and update the minimum requirement to Cython 3.0.
In updating one of my development environments, I discovered that Cython has released version 3.0 after our 2.0.1.post1 release. This exposes a few issues (none of which are fatal) with our implementation:
While we were getting a warning about using a deprecated NumPy API under Cython 0.29, Cython 3.0 now makes it possible to remove the warning. Use the migration guide to update the build appropriately.
It appears that Cython 3.0 deprecated the "
DEF
" statement (cython/cython#4310). This affects thesbdf.pyx
module, but only for the static constants used to process dates, times, and decimal values. Refactor this usage to avoid triggering the (currently) warning.Along with the "
DEF
" statement, the "IF
" statement used to conditionalize the platform-specific code incodesign.pyx
andcabfile.pyx
is now deprecated also. Since the recommended options don't work well for platform-specific code, we need to refactor these modules so that the platform-specific code is in separate files and the conditionality is moved into thesetup.py
script (making sure to remove the current logic that excludes the generated C files from the distribution and thecython_c_in_temp
flag on the Extension objects).It appears that Cython 3.0 has updated exception handling propagation for
cdef
functions declared withoutexcept
clauses. While this should automatically fix part of #44, we should check other uses and either move to using the new "noexcept
" clause where exceptions should not be propagated, or remove places where we explicitly added "except *
" clauses to force propagation.Fix these issues and update the minimum requirement to Cython 3.0.