ENH: refactor Cython file generation #14890
Labels
Cython
Issues with the internal Cython code base
Meson
Items related to the introduction of Meson as the new build system for SciPy
scipy.special
task
A straightforward change, verification or fix.
Is your feature request related to a problem? Please describe.
See: rgommers#84 (review)
The current state of our Cython generation code could do with cleanup and refactor, and in particular:
generate_ufuncs
,generate_ufuncs_type_stubs
andgenerate_fused_funcs
The original (pre-meson) code in SciPy gave:
from
generate_ufuncs
, while in the Meson build changes about to be merged, it looks like:This is due to the changes under
if __name__ == "__main__"
:.Describe the solution you'd like.
Using relative paths in the generated code seems better/safer (e.g., in case we ever go back to shipping pre-generated Cython sources). So rather than this fix, it would be better to improve this script by separating the contents of the files from the location that those files get written to. That probably means a separate outdir argument for
generate_ufuncs
, generate_ufuncs_type_stubs and generate_fused_funcs, or refactoring those functions to really separate out the code generation from the file writing parts.Describe alternatives you've considered.
No response
Additional context (e.g. screenshots, GIFs)
No response
The text was updated successfully, but these errors were encountered: