517: Change build_backend to build-backend (#139)

The key is in the build-system table, so making this a dash would
improve consistency. On English keyboards, it also avoids needing to
press shift. There seemed to be a consensus on distutils-sig in favour
of this change.
This commit is contained in:
Thomas Kluyver 2016-11-28 18:28:44 +00:00 committed by Brett Cannon
parent 024a7d586f
commit b12bc6a9fe
1 changed files with 6 additions and 6 deletions

View File

@ -103,15 +103,15 @@ to it as the ``setup.py``\-style.
Here we define a new style of source tree based around the Here we define a new style of source tree based around the
``pyproject.toml`` file defined in PEP 518, extending the ``pyproject.toml`` file defined in PEP 518, extending the
``[build-system]`` table in that file with one additional key, ``[build-system]`` table in that file with one additional key,
``build_backend``. Here's an example of how it would look:: ``build-backend``. Here's an example of how it would look::
[build-system] [build-system]
# Defined by PEP 518: # Defined by PEP 518:
requires = ["flit"] requires = ["flit"]
# Defined by this PEP: # Defined by this PEP:
build_backend = "flit.api:main" build-backend = "flit.api:main"
``build_backend`` is a string naming a Python object that will be ``build-backend`` is a string naming a Python object that will be
used to perform the build (see below for details). This is formatted used to perform the build (see below for details). This is formatted
following the same ``module:object`` syntax as a ``setuptools`` entry following the same ``module:object`` syntax as a ``setuptools`` entry
point. For instance, if the string is ``"flit.api:main"`` as in the point. For instance, if the string is ``"flit.api:main"`` as in the
@ -123,7 +123,7 @@ equivalent of::
It's also legal to leave out the ``:object`` part, e.g. :: It's also legal to leave out the ``:object`` part, e.g. ::
build_backend = "flit.api" build-backend = "flit.api"
which acts like:: which acts like::
@ -141,11 +141,11 @@ And we import ``module_path`` and then lookup
``module_path.object_path`` (or just ``module_path`` if ``module_path.object_path`` (or just ``module_path`` if
``object_path`` is missing). ``object_path`` is missing).
If the ``pyproject.toml`` file is absent, or the ``build_backend`` If the ``pyproject.toml`` file is absent, or the ``build-backend``
key is missing, the source tree is not using this specification, and key is missing, the source tree is not using this specification, and
tools should fall back to running ``setup.py``. tools should fall back to running ``setup.py``.
Where the ``build_backend`` key exists, it takes precedence over Where the ``build-backend`` key exists, it takes precedence over
``setup.py``, and source trees need not include ``setup.py`` at all. ``setup.py``, and source trees need not include ``setup.py`` at all.
Projects may still wish to include a ``setup.py`` for compatibility Projects may still wish to include a ``setup.py`` for compatibility
with tools that do not use this spec. with tools that do not use this spec.