Fix imports that fail under Cython 3.0 in language_level=3 mode #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: I recognize that #85 has already been merged and released. I made the changes in this PR in an equivalent proposal for sparse_dot_topn_for_blocks, so I thought I'd make the same offer in this repository if the maintainers are interested in not having Cython pinned to < 3.0.0.
The release of Cython 3.0 on July 27, 2023 broke the build for this package by introducing breaking changes. This PR addresses those changes and fixes a few imports that no longer work with Cython 3.0. These changes are also backwards compatible for people who decide to build this package using older versions of Cython.
This addresses issue #84 in this repository, as well as a few issues found in other repos.
ParticularMiner/sparse_dot_topn_for_blocks#3
Bergvca/string_grouper#93
Also just because I was curious, if you really didn't want to change the imports and wanted everything to go back to the way it was without pinning the version, you can configure Cython to go back to the old behavior. You have to add Cython to the build-system requires in
pyproject.toml
, addfrom Cython.Build import cythonize
tosetup.py
, and then change line 95 toext_modules=cythonize([array_wrappers_ext, original_ext, threaded_ext], language_level='2'),
.