Skip to content

Commit

Permalink
build: switch to tomli for TOML v1 compliant parser
Browse files Browse the repository at this point in the history
Fixes pypa#308

Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Aug 1, 2021
1 parent e6a82a1 commit 117ede1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -9,6 +9,7 @@ Unreleased
- Improved output (`PR #333`_, Fixes `#142`_)
- The CLI now honnors `NO_COLOR`_ (`PR #333`_)
- Added logging to ``build`` and ``build.env`` (`PR #333`_)
- Switch to a TOML v1 compliant parser (`PR #336`_, Fixes `#308`_)


Breaking Changes
Expand All @@ -17,7 +18,9 @@ Breaking Changes
- Dropped support for Python 2 and 3.5.

.. _PR #333: https://github.com/pypa/build/pull/333
.. _PR #336: https://github.com/pypa/build/pull/336
.. _#142: https://github.com/pypa/build/issues/142
.. _#308: https://github.com/pypa/build/issues/308
.. _NO_COLOR: https://no-color.org


Expand Down
6 changes: 6 additions & 0 deletions docs/installation.rst
Expand Up @@ -37,6 +37,9 @@ This package can build itself with only the ``toml`` and ``pep517``
dependencies. The ``--skip-dependency-check`` flag should be used in this
case.

We have a dependency on tomli_, but toml_ can be used instead, which may make
bootstraping easier.


Compatibility
=============
Expand Down Expand Up @@ -66,6 +69,9 @@ versions:
.. _git tag: https://github.com/pypa/build/tags
.. _project page: https://pypi.org/project/build/

.. _tomli: https://github.com/hukkin/tomli
.. _toml: https://github.com/uiri/toml


.. |3DCE51D60930EBA47858BA4146F633CBB0EB4BF2| replace:: ``3DCE51D60930EBA47858BA4146F633CBB0EB4BF2``
.. _3DCE51D60930EBA47858BA4146F633CBB0EB4BF2: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3dce51d60930eba47858ba4146f633cbb0eb4bf2
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -27,7 +27,7 @@ packages = find:
install_requires =
packaging>=19.0
pep517>=0.9.1
toml>=0.10.0
tomli>=1.0.0 # toml can be used instead
colorama;os_name == "nt" # not actually a runtime dependency, only supplied as there is not "recomended dependency" support
importlib-metadata>=0.22;python_version < "3.8"
python_requires = >=3.6
Expand Down
7 changes: 6 additions & 1 deletion src/build/__init__.py
Expand Up @@ -20,7 +20,12 @@
from typing import AbstractSet, Any, Callable, Dict, Iterator, Mapping, Optional, Sequence, Set, Tuple, Type, Union

import pep517.wrappers
import toml


try:
import tomli as toml
except ModuleNotFoundError:
import toml # type: ignore # pragma: no cover


RunnerType = Callable[[Sequence[str], Optional[str], Optional[Mapping[str, str]]], None]
Expand Down

0 comments on commit 117ede1

Please sign in to comment.