Support TOML v1.0.0 syntax in `pyproject.toml`
This commit is contained in:
parent
8347b59295
commit
e942b12b94
|
@ -58,7 +58,7 @@ repos:
|
|||
- py>=1.8.2
|
||||
- attrs>=19.2.0
|
||||
- packaging
|
||||
- types-toml
|
||||
- tomli
|
||||
- types-pkg_resources
|
||||
- repo: local
|
||||
hooks:
|
||||
|
|
1
AUTHORS
1
AUTHORS
|
@ -302,6 +302,7 @@ Sven-Hendrik Haase
|
|||
Sylvain Marié
|
||||
Tadek Teleżyński
|
||||
Takafumi Arakaki
|
||||
Taneli Hukkinen
|
||||
Tanvi Mehta
|
||||
Tarcisio Fischer
|
||||
Tareq Alayan
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Support TOML v1.0.0 syntax in ``pyproject.toml``.
|
|
@ -47,7 +47,7 @@ install_requires =
|
|||
packaging
|
||||
pluggy>=0.12,<1.0.0a1
|
||||
py>=1.8.2
|
||||
toml
|
||||
tomli>=1.0.0,<2.0.0
|
||||
atomicwrites>=1.0;sys_platform=="win32"
|
||||
colorama;sys_platform=="win32"
|
||||
importlib-metadata>=0.12;python_version<"3.8"
|
||||
|
|
|
@ -64,9 +64,9 @@ def load_config_dict_from_file(
|
|||
|
||||
# '.toml' files are considered if they contain a [tool.pytest.ini_options] table.
|
||||
elif filepath.suffix == ".toml":
|
||||
import toml
|
||||
import tomli
|
||||
|
||||
config = toml.load(str(filepath))
|
||||
config = tomli.loads(filepath.read_text(encoding="utf-8"))
|
||||
|
||||
result = config.get("tool", {}).get("pytest", {}).get("ini_options", None)
|
||||
if result is not None:
|
||||
|
|
|
@ -77,6 +77,7 @@ class TestLoadConfigDictFromFile:
|
|||
y = 20.0
|
||||
values = ["tests", "integration"]
|
||||
name = "foo"
|
||||
heterogeneous_array = [1, "str"]
|
||||
"""
|
||||
),
|
||||
encoding="utf-8",
|
||||
|
@ -86,6 +87,7 @@ class TestLoadConfigDictFromFile:
|
|||
"y": "20.0",
|
||||
"values": ["tests", "integration"],
|
||||
"name": "foo",
|
||||
"heterogeneous_array": [1, "str"],
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue