Repository navigation
Conversation
Cython infers a module's qualified name from the structure implied by `__init__.py`. Old CMake build copied the whole symengine/ package into the build tree (`file(COPY symengine/ ...)` in the top-level CMakeLists.txt), so those files were present.
Since the move to scikit-build-core builds compile the wrapper with the module name `symengine_wrapper` instead of `symengine.lib.symengine_wrapper` and `Symbol('x').__module__ == "symengine_wrapper"` that breaks pickles across process.
This only occurs on non-editable installs and builds outside the source tree that have `__init__.py` files in the right structure and my proposed fix is to create dummy `__init__.py` files to produce the correct import structure if they don't already exist (which they do for in-tree builds).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cython infers a module's qualified name from the structure implied by
__init__.py. Old CMake build copied the whole symengine/ package into the build tree (file(COPY symengine/ ...)in the top-level CMakeLists.txt), so those files were present.Since the move to scikit-build-core builds compile the wrapper with the module name
symengine_wrapperinstead ofsymengine.lib.symengine_wrapperandSymbol('x').__module__ == "symengine_wrapper"that breaks pickles across process.This only occurs on non-editable installs and builds outside the source tree that have
__init__.pyfiles in the right structure and my proposed fix is to create dummy__init__.pyfiles to produce the correct import structure if they don't already exist (which they do for in-tree builds).To reproduce (before the fix):
Running
I'm not sure how to test this in CI since CI does in-tree builds and the module name resolves correctly.
It'd be great to get this in before 0.15 since we depend on this for PyCalphad and have been stuck pinned
<0.14for awhile