cython compiler code example

Example: python setuptools cythonize except one file

packages = find_packages(exclude=('tests',))

def get_package_files_in_directory(directory):
    paths = []
    for (path, directories, filenames) in os.walk(directory):
        for filename in filenames:
            paths.append(os.path.join('..', path, filename))
    return paths


setup(
    packages=[],

    ext_modules=cythonize(
        [
           Extension("main_folder.*", ["main_folder/*.py"])

        ],
        build_dir="build",
        compiler_directives=dict(
        always_allow_keywords=True
        )),
package_data={p: package_files + get_package_files_in_directory(os.path.join(here, p, 'resources')) for p in packages},
,....
,...
)