File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/scikit_build_core/build Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -325,9 +325,19 @@ def _build_wheel_impl(
325325 f"_{ normalized_name } _editable.py" ,
326326 editable_txt .encode ("utf-8" ),
327327 )
328+ # Support Cython by adding the source directory directly to the path.
329+ # This is necessary because Cython does not support sys.meta_path for
330+ # cimports (as of 3.0.5).
331+ pth_import_paths = (
332+ f"import _{ normalized_name } _editable\n "
333+ + "\n " .join (
334+ os .fspath (Path (pkg ).parent .resolve ()) for pkg in packages
335+ )
336+ + "\n "
337+ )
328338 wheel .writestr (
329339 f"_{ normalized_name } _editable.pth" ,
330- f"import _ { normalized_name } _editable \n " .encode (),
340+ pth_import_paths .encode (),
331341 )
332342
333343 if metadata_directory is not None :
You can’t perform that action at this time.
0 commit comments