Skip to content

Add a separate "build_cython" command to setup.py #21682

@embray

Description

@embray

This is a follow-on to #21600. It adds a new cythonize command to the setup.py, and moves most of the logic for running cythonize() (previously in the customized build_ext) command, into this new command.

The new cythonize command is run always from build_ext anyways, but this has a couple advantages:

  1. It is possible to run just cythonize, without compiling extension modules. This maybe isn't that common, but can be useful for development, especially when testing issues with Cython itself. It will also be useful for generating source distributions, where we might want to ship Cythonized sources in the source tarball, and hence would need to generate them as part of the process of building the tarball (without necessarily compiling).

This also allows passing options directly from the command-line to cythonize. This isn't much taken advantage of currently but the possibility is there.

  1. Code is clearer and more modular. Specific details for compiling cython code are kept separate from details for compiling C/C++ code.

See also upstream discussion of a "generic" implementation: cython/cython#1514

Upstream: Reported upstream. Developers acknowledge bug.

CC: @mkoeppe

Component: build

Keywords: cython distutils

Author: Erik Bray

Branch/Commit: a049f2d

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/21682

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions