diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-10-28 10:20:01 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2018-10-28 10:20:01 -0400 |
| commit | 912f772c61ce432561423e91a8ace70b0ec86a08 (patch) | |
| tree | cc5c25be9a7761461137e6d03b640a0bb7388b1e | |
| parent | fb84b3fdfd6d4e010d8397efacf4388ee418da7f (diff) | |
| download | python-setuptools-git-912f772c61ce432561423e91a8ace70b0ec86a08.tar.gz | |
Update recommendation. Fixes #1549.
| -rw-r--r-- | docs/setuptools.txt | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/docs/setuptools.txt b/docs/setuptools.txt index ec40548a..3cad38b1 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -1655,17 +1655,26 @@ Distributing Extensions compiled with Cython -------------------------------------------- ``setuptools`` will detect at build time whether Cython is installed or not. -If Cython is not found ``setputools`` will ignore pyx files. In case it's -available you are supposed it will work with just a couple of adjustments. -``setuptools`` includes transparent support for building Cython extensions, as -long as you define your extensions using ``setuptools.Extension``. -Then you should use Cython own ``build_ext`` in ``cmdclass``, e.g.:: +If Cython is not found ``setputools`` will ignore pyx files. - from Cython.Distutils import build_ext +To ensure Cython is available, include Cython in the build-requires section +of your pyproject.toml:: - setup(... - cmdclass={"build_ext": build_ext} - ...) + [build-system] + requires=[..., 'cython'] + +Built with pip 10 or later, that declaration is sufficient to include Cython +in the build. For broader compatibility, declare the dependency in your +setup-requires of setup.cfg:: + + [options] + setup_requires = + ... + cython + +As long as Cython is present in the build environment, ``setuptools`` includes +transparent support for building Cython extensions, as +long as extensions are defined using ``setuptools.Extension``. If you follow these rules, you can safely list ``.pyx`` files as the source of your ``Extension`` objects in the setup script. If it is, then ``setuptools`` @@ -2505,7 +2514,7 @@ data_files dict 40.5.0 accepts the same keys as the `setuptools.find_packages` and the `setuptools.find_namespace_packages` function: ``where``, ``include``, and ``exclude``. - + **find_namespace directive** - The ``find_namespace:`` directive is supported since Python >=3.3. |
