Skip to content

Failed getting this to work #45

@itamarst

Description

@itamarst

I was very glad to see this existed but I cannot figure how to use it.

I want to have a .py file that is both importable from Python and compiled via Cython (so we can distribute source-only wheel as fallback). With setuptools I would try something like this (untested):

from setuptools import setup, Extension
from Cython.Build import cythonize

setup(
    ext_modules=cythonize(
        [
            Extension(
                "twisted.internet._deferred_cython",
                sources=["src/twisted/internet/_deferred_base.py"],
            )
        ]
    )
)

Unfortunately I can't figure how one would do this with the current config format. I am particularly confused by the fact that there's no way to list which files an extension should have, or at least no documented way. My initial attempts resulted in every single .py file being compiled as an extension, which is probably not ideal 😁

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions