cython/cython

Cythonize/Cython compilation fails to import/recognize `.pxd` from external modules that only have `__init__.so`

Open

#2.886 geöffnet am 4. März 2019

Auf GitHub ansehen
 (4 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Python (1.517 Forks)batch import
Build Systemenhancementgood first issue

Repository-Metriken

Stars
 (8.663 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 45T 12h) (52 gemergte PRs in 30 T)

Beschreibung

When trying to use a .pxd from an external module and making sure it can be found on sys.path, Cythonize/Cython compilation will still fail to pick it up if that module only has __init__.cpython-36m-x86_64-linux-gnu.so but no __init__.py (which it obviously couldn't have, given the __init__ part is already that C extension).

As soon as I do touch __init__.py in that folder it's all picked up fine, but of course that's not really a meaningful thing to do and renders the module broken, which I think I shouldn't have to do just so I can import .pxd files from it, should I?

So this looks a bit like a Cython bug to me, tested with Cython 0.29.6

Contributor Guide