[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-04-13 00:00:18 +00:00
parent 72ad6dc953
commit f4cd1ba0d6
813 changed files with 66015 additions and 58839 deletions

View file

@ -1,12 +1,14 @@
from __future__ import annotations
import glob
import os
import subprocess
import sys
import tempfile
from distutils import log
from distutils.errors import DistutilsError
import pkg_resources
from distutils import log
from distutils.errors import DistutilsError
from setuptools.wheel import Wheel
@ -34,8 +36,10 @@ def fetch_build_egg(dist, req): # noqa: C901 # is too complex (16) # FIXME
# take precedence.
opts = dist.get_option_dict('easy_install')
if 'allow_hosts' in opts:
raise DistutilsError('the `allow-hosts` option is not supported '
'when using pip to install requirements.')
raise DistutilsError(
'the `allow-hosts` option is not supported '
'when using pip to install requirements.',
)
quiet = 'PIP_QUIET' not in os.environ and 'PIP_VERBOSE' not in os.environ
if 'PIP_INDEX_URL' in os.environ:
index_url = None
@ -79,9 +83,11 @@ def fetch_build_egg(dist, req): # noqa: C901 # is too complex (16) # FIXME
dist_location = os.path.join(eggs_dir, wheel.egg_name())
wheel.install_as_egg(dist_location)
dist_metadata = pkg_resources.PathMetadata(
dist_location, os.path.join(dist_location, 'EGG-INFO'))
dist_location, os.path.join(dist_location, 'EGG-INFO'),
)
dist = pkg_resources.Distribution.from_filename(
dist_location, metadata=dist_metadata)
dist_location, metadata=dist_metadata,
)
return dist