Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace vendored toml with tomli for TOML v1.0.0 compat #10035

Merged
merged 6 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/10034.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support TOML v1.0.0 syntax in ``pyproject.toml``.
4 changes: 2 additions & 2 deletions src/pip/_internal/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from collections import namedtuple
from typing import Any, List, Optional

from pip._vendor import toml
from pip._vendor import tomli
from pip._vendor.packaging.requirements import InvalidRequirement, Requirement

from pip._internal.exceptions import InstallationError
Expand Down Expand Up @@ -59,7 +59,7 @@ def load_pyproject_toml(

if has_pyproject:
with open(pyproject_toml, encoding="utf-8") as f:
pp_toml = toml.load(f)
pp_toml = tomli.load(f)
build_system = pp_toml.get("build-system")
else:
build_system = None
Expand Down
4 changes: 2 additions & 2 deletions src/pip/_vendor/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Vendoring Policy
pure Python.
* Any modifications made to libraries **MUST** be noted in
``pip/_vendor/README.rst`` and their corresponding patches **MUST** be
included ``tools/automation/vendoring/patches``.
included ``tools/vendoring/patches``.
pradyunsg marked this conversation as resolved.
Show resolved Hide resolved
* Vendored libraries should have corresponding ``vendored()`` entries in
``pip/_vendor/__init__.py``.

Expand Down Expand Up @@ -118,7 +118,7 @@ Automatic Vendoring

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


Expand Down
4 changes: 1 addition & 3 deletions src/pip/_vendor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,5 @@ def vendored(modulename):
vendored("requests.packages.urllib3.util.url")
vendored("resolvelib")
vendored("tenacity")
vendored("toml")
vendored("toml.encoder")
vendored("toml.decoder")
vendored("tomli")
vendored("urllib3")
2 changes: 1 addition & 1 deletion src/pip/_vendor/pep517/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
import logging
import os
from pip._vendor import toml
import toml
import shutil

from .envbuild import BuildEnvironment
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_vendor/pep517/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import os
from os.path import isfile, join as pjoin
from pip._vendor.toml import TomlDecodeError, load as toml_load
from toml import TomlDecodeError, load as toml_load
import shutil
from subprocess import CalledProcessError
import sys
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_vendor/pep517/envbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import os
import logging
from pip._vendor import toml
import toml
import shutil
from subprocess import check_call
import sys
Expand Down
1 change: 0 additions & 1 deletion src/pip/_vendor/toml.pyi

This file was deleted.

25 changes: 0 additions & 25 deletions src/pip/_vendor/toml/__init__.py

This file was deleted.

Loading