This is a toy version of a problem I have. I'm trying to use setuptools to compile some Cython code in place, as part of a larger project.
My topdir is test. It contains:
hello_world.pyx
def say_hi():
print('meh')
and setup.py
from setuptools import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize("hello.pyx"),
)
If I build these modules in place with python3 setup.py build_ext --inplace, everything works as expected.
But if add an empty __init__.py to my topdir, I get the following error:
copying build/lib.linux-x86_64-3.8/Code/test/hello.cpython-38-x86_64-linux-gnu.so -> Code/test
error: could not create 'Code/test/hello.cpython-38-x86_64-linux-gnu.so': No such file or directory
Why is this happening? And is there a standard way of fixing it? I would like for these compiled Cython modules to live alongside some other C/Python code which is still in development.