Skip to content

Conversation

@jakirkham
Copy link
Member

As the modules we Cythonize are .py file, both the compiled extension and the .py file get installed. On macOS and Linux, this doesn't appear to present an issue as the .so will be loaded before the .py file. So the .py files are effectively ignored on these platforms. However it seems Windows loads the .py file before the .pyd (Windows compiled extension).

To fix this, we make some tweaks to the build process. Namely we rename the .py file to a .pyx file, which exclude from packaging (just as we exclude the .c file Cython generates). Thus we avoid having two files with the same name and different file extensions, which may be loaded in arbitrary order. We make sure to return the source directory to the original state by reverting the renaming when we are done.

For this to work effectively on CI, we start installing into the Conda environment instead of doing an editable install. This way we know only the compiled extension was installed.

Get rid of the `setup_requires` as that has been raised as a concern.
Instead simply raise an informative error and exit. This way it is up to
users to address this reasonably somehow.
@mrocklin
Copy link
Member

mrocklin commented Dec 8, 2020

Happy to defer entirely to you on this one :)

As we have only explored Cythonizing one function here and it is not as
critical as Cythonizing the Scheduler, go ahead and skip this module for
now. We can always add it back later.
@jakirkham jakirkham mentioned this pull request Jan 19, 2021
Base automatically changed from master to main March 8, 2021 19:04
@jakirkham
Copy link
Member Author

Addressing with PR ( #4764 )

@jakirkham jakirkham closed this Apr 29, 2021
@jakirkham jakirkham deleted the fixup_bld branch April 29, 2021 00:14
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