Skip to content

Commit bd5ac26

Browse files
authored
Merge pull request #10035 from hukkin/tomli
2 parents ad3d498 + 1915c4d commit bd5ac26

22 files changed

+815
-1450
lines changed

news/10034.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support TOML v1.0.0 syntax in ``pyproject.toml``.

src/pip/_internal/pyproject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from collections import namedtuple
33
from typing import Any, List, Optional
44

5-
from pip._vendor import toml
5+
from pip._vendor import tomli
66
from pip._vendor.packaging.requirements import InvalidRequirement, Requirement
77

88
from pip._internal.exceptions import InstallationError
@@ -59,7 +59,7 @@ def load_pyproject_toml(
5959

6060
if has_pyproject:
6161
with open(pyproject_toml, encoding="utf-8") as f:
62-
pp_toml = toml.load(f)
62+
pp_toml = tomli.load(f)
6363
build_system = pp_toml.get("build-system")
6464
else:
6565
build_system = None

src/pip/_vendor/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Vendoring Policy
1616
pure Python.
1717
* Any modifications made to libraries **MUST** be noted in
1818
``pip/_vendor/README.rst`` and their corresponding patches **MUST** be
19-
included ``tools/automation/vendoring/patches``.
19+
included ``tools/vendoring/patches``.
2020
* Vendored libraries should have corresponding ``vendored()`` entries in
2121
``pip/_vendor/__init__.py``.
2222

@@ -118,7 +118,7 @@ Automatic Vendoring
118118

119119
Vendoring is automated via the `vendoring <https://pypi.org/project/vendoring/>`_ tool from the content of
120120
``pip/_vendor/vendor.txt`` and the different patches in
121-
``tools/automation/vendoring/patches``.
121+
``tools/vendoring/patches``.
122122
Launch it via ``vendoring sync . -v`` (requires ``vendoring>=0.2.2``).
123123

124124

src/pip/_vendor/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,5 @@ def vendored(modulename):
107107
vendored("requests.packages.urllib3.util.url")
108108
vendored("resolvelib")
109109
vendored("tenacity")
110-
vendored("toml")
111-
vendored("toml.encoder")
112-
vendored("toml.decoder")
110+
vendored("tomli")
113111
vendored("urllib3")

src/pip/_vendor/pep517/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import argparse
44
import logging
55
import os
6-
from pip._vendor import toml
6+
import toml
77
import shutil
88

99
from .envbuild import BuildEnvironment

src/pip/_vendor/pep517/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
import os
66
from os.path import isfile, join as pjoin
7-
from pip._vendor.toml import TomlDecodeError, load as toml_load
7+
from toml import TomlDecodeError, load as toml_load
88
import shutil
99
from subprocess import CalledProcessError
1010
import sys

src/pip/_vendor/pep517/envbuild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import os
55
import logging
6-
from pip._vendor import toml
6+
import toml
77
import shutil
88
from subprocess import check_call
99
import sys

src/pip/_vendor/toml.pyi

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/pip/_vendor/toml/__init__.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)