示例#1
0
    def check_cythonized_extensions(self):
        options = self.distribution.ext_modules.options

        if 'include_path' not in options:
            options['include_path'] = ['.']

        from Cython.Build.Dependency import create_extension_list
        from Cython.Compiler.Main import Context
        from Cython.Compiler.Options import CompilationOptions

        c_options = CompilationOptions(**options)
        ctx = Context.from_options(c_options)
        options = c_options

        module_list, _ = create_extension_list(
            self.distribution.ext_modules,
            ctx=ctx,
            **options,
        )
示例#2
0
文件: setup.py 项目: odellma/pygame
    # So you can `setup.py cython` or `setup.py cython install`
    try:
        from Cython.Build.Dependencies import cythonize_one
    except ImportError:
        print(
            "You need cython. https://cython.org/, pip install cython --user")
        sys.exit(1)

    from Cython.Build.Dependencies import create_extension_list
    from Cython.Build.Dependencies import create_dependency_tree

    try:
        from Cython.Compiler.Main import Context
        from Cython.Compiler.Options import CompilationOptions, default_options

        c_options = CompilationOptions(default_options)
        ctx = Context.from_options(c_options)
    except ImportError:
        from Cython.Compiler.Main import Context, CompilationOptions, default_options

        c_options = CompilationOptions(default_options)
        ctx = c_options.create_context()

    import glob
    pyx_files = glob.glob(os.path.join('src_c', 'cython', 'pygame', '*.pyx')) + \
                glob.glob(os.path.join('src_c', 'cython', 'pygame', '**', '*.pyx'))

    pyx_files, pyx_meta = create_extension_list(pyx_files, ctx=ctx)
    deps = create_dependency_tree(ctx)

    queue = []