includesContents = ''
for f in os.listdir('src-dir'):
    if f.endswith('.pyx'):
        includesContents += 'include "' + f + '"\n'
includesFile = open('src/extension-name.pyx', 'w')
includesFile.write(includesContents)
includesFile.close()
Свернуть несколько подмодулей в одно расширение Cython