Skip to content

Commit b0eb95b

Browse files
committed
Upgrade pep517 to 0.12.0
1 parent 619b257 commit b0eb95b

File tree

9 files changed

+34
-6
lines changed

9 files changed

+34
-6
lines changed

news/pep517.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade pep517 to 0.12.0

src/pip/_vendor/pep517/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Wrappers to build Python packages using PEP 517 hooks
22
"""
33

4-
__version__ = '0.11.0'
4+
__version__ = '0.12.0'
55

66
from .wrappers import * # noqa: F401, F403

src/pip/_vendor/pep517/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def load_system(source_dir):
3131
Load the build system from a source dir (pyproject.toml).
3232
"""
3333
pyproject = os.path.join(source_dir, 'pyproject.toml')
34-
with io.open(pyproject, encoding="utf-8") as f:
34+
with io.open(pyproject, 'rb') as f:
3535
pyproject_data = toml_load(f)
3636
return pyproject_data['build-system']
3737

src/pip/_vendor/pep517/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def check(source_dir):
142142
return False
143143

144144
try:
145-
with io.open(pyproject, encoding="utf-8") as f:
145+
with io.open(pyproject, 'rb') as f:
146146
pyproject_data = toml_load(f)
147147
# Ensure the mandatory data can be loaded
148148
buildsys = pyproject_data['build-system']

src/pip/_vendor/pep517/compat.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Python 2/3 compatibility"""
2+
import io
23
import json
34
import sys
45

@@ -35,7 +36,15 @@ def read_json(path):
3536

3637

3738
if sys.version_info < (3, 6):
38-
from toml import load as toml_load # noqa: F401
39+
from toml import load as _toml_load # noqa: F401
40+
41+
def toml_load(f):
42+
w = io.TextIOWrapper(f, encoding="utf8", newline="")
43+
try:
44+
return _toml_load(w)
45+
finally:
46+
w.detach()
47+
3948
from toml import TomlDecodeError as TOMLDecodeError # noqa: F401
4049
else:
4150
from pip._vendor.tomli import load as toml_load # noqa: F401

src/pip/_vendor/pep517/envbuild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def _load_pyproject(source_dir):
2020
with io.open(
2121
os.path.join(source_dir, 'pyproject.toml'),
22-
encoding="utf-8",
22+
'rb',
2323
) as f:
2424
pyproject_data = toml_load(f)
2525
buildsys = pyproject_data['build-system']

src/pip/_vendor/pep517/in_process/_in_process.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ def _build_backend():
103103
return obj
104104

105105

106+
def _supported_features():
107+
"""Return the list of options features supported by the backend.
108+
109+
Returns a list of strings.
110+
The only possible value is 'build_editable'.
111+
"""
112+
backend = _build_backend()
113+
features = []
114+
if hasattr(backend, "build_editable"):
115+
features.append("build_editable")
116+
return features
117+
118+
106119
def get_requires_for_build_wheel(config_settings):
107120
"""Invoke the optional get_requires_for_build_wheel hook
108121
@@ -312,6 +325,7 @@ def build_sdist(sdist_directory, config_settings):
312325
'build_editable',
313326
'get_requires_for_build_sdist',
314327
'build_sdist',
328+
'_supported_features',
315329
}
316330

317331

src/pip/_vendor/pep517/wrappers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ def subprocess_runner(self, runner):
154154
finally:
155155
self._subprocess_runner = prev
156156

157+
def _supported_features(self):
158+
"""Return the list of optional features supported by the backend."""
159+
return self._call_hook('_supported_features', {})
160+
157161
def get_requires_for_build_wheel(self, config_settings=None):
158162
"""Identify packages required for building a wheel
159163

src/pip/_vendor/vendor.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ distro==1.6.0
55
html5lib==1.1
66
msgpack==1.0.2
77
packaging==21.0
8-
pep517==0.11.0
8+
pep517==0.12.0
99
platformdirs==2.4.0
1010
progress==1.6
1111
pyparsing==2.4.7

0 commit comments

Comments
 (0)