@@ -73,11 +73,8 @@ def test_editable_redirect():
7373def test_editable_redirect_pxd ():
7474 """Test that .pxd/.pyx __init__ files are recognized as packages.
7575
76- This mirrors real-world Cython projects (e.g. cuVS) where packages have
77- both __init__.py and __init__.pxd, and where the file scanner may pick up
78- the .pxd as the representative file for the package init.
79- The key fix: the parent package's __path__ must NOT be polluted with the
80- child package's directory.
76+ If packages have both __init__.py and __init__.pxd, the file scanner may pick up the
77+ .pxd as the representative file for the package init and produce the wrong __path__.
8178 """
8279 known_source_files = process_dict (
8380 {
@@ -107,15 +104,15 @@ def test_editable_redirect_pxd():
107104 install_dir = "" ,
108105 )
109106
110- # Fix A: .pxd/.pyx init files should be recognized as packages
107+ # .pxd/.pyx init files should be recognized as packages
111108 assert "pkg.cython_subpkg" in finder .pkgs
112109 assert "pkg.pyx_subpkg" in finder .pkgs
113110
114- # Fix A: Cython subpackages must have their OWN search locations
111+ # Cython subpackages must have their OWN search locations
115112 assert "pkg.cython_subpkg" in finder .submodule_search_locations
116113 assert "pkg.pyx_subpkg" in finder .submodule_search_locations
117114
118- # Critical: parent pkg.__path__ must NOT be polluted with child package dirs
115+ # parent pkg.__path__ must NOT be polluted with child package dirs
119116 pkg_paths = finder .submodule_search_locations .get ("pkg" , set ())
120117 assert not any ("cython_subpkg" in p for p in pkg_paths ), (
121118 f"pkg.__path__ is polluted with cython_subpkg: { pkg_paths } "
0 commit comments