mirror of https://github.com/pypa/pip
Prepare isort for black
This commit is contained in:
parent
a00f85d22b
commit
58c594c06b
|
@ -1,4 +1,5 @@
|
||||||
[isort]
|
[isort]
|
||||||
|
profile = black
|
||||||
skip =
|
skip =
|
||||||
./build,
|
./build,
|
||||||
.nox,
|
.nox,
|
||||||
|
@ -6,14 +7,12 @@ skip =
|
||||||
.scratch,
|
.scratch,
|
||||||
_vendor,
|
_vendor,
|
||||||
data
|
data
|
||||||
multi_line_output = 3
|
|
||||||
known_third_party =
|
known_third_party =
|
||||||
pip._vendor
|
pip._vendor
|
||||||
known_first_party =
|
known_first_party =
|
||||||
pip
|
pip
|
||||||
tests
|
tests
|
||||||
default_section = THIRDPARTY
|
default_section = THIRDPARTY
|
||||||
include_trailing_comma = true
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
|
|
|
@ -12,10 +12,7 @@ import traceback
|
||||||
|
|
||||||
from pip._internal.cli import cmdoptions
|
from pip._internal.cli import cmdoptions
|
||||||
from pip._internal.cli.command_context import CommandContextMixIn
|
from pip._internal.cli.command_context import CommandContextMixIn
|
||||||
from pip._internal.cli.parser import (
|
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
|
||||||
ConfigOptionParser,
|
|
||||||
UpdatingDefaultsHelpFormatter,
|
|
||||||
)
|
|
||||||
from pip._internal.cli.status_codes import (
|
from pip._internal.cli.status_codes import (
|
||||||
ERROR,
|
ERROR,
|
||||||
PREVIOUS_BUILD_DIR_ERROR,
|
PREVIOUS_BUILD_DIR_ERROR,
|
||||||
|
@ -35,10 +32,7 @@ from pip._internal.utils.deprecation import deprecated
|
||||||
from pip._internal.utils.filesystem import check_path_owner
|
from pip._internal.utils.filesystem import check_path_owner
|
||||||
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
|
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
|
||||||
from pip._internal.utils.misc import get_prog, normalize_path
|
from pip._internal.utils.misc import get_prog, normalize_path
|
||||||
from pip._internal.utils.temp_dir import (
|
from pip._internal.utils.temp_dir import global_tempdir_manager, tempdir_registry
|
||||||
global_tempdir_manager,
|
|
||||||
tempdir_registry,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.virtualenv import running_under_virtualenv
|
from pip._internal.utils.virtualenv import running_under_virtualenv
|
||||||
|
|
||||||
|
@ -46,8 +40,9 @@ if MYPY_CHECK_RUNNING:
|
||||||
from optparse import Values
|
from optparse import Values
|
||||||
from typing import Any, List, Optional, Tuple
|
from typing import Any, List, Optional, Tuple
|
||||||
|
|
||||||
from pip._internal.utils.temp_dir import \
|
from pip._internal.utils.temp_dir import (
|
||||||
TempDirectoryTypeRegistry as TempDirRegistry
|
TempDirectoryTypeRegistry as TempDirRegistry,
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = ['Command']
|
__all__ = ['Command']
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from pip._internal.cli import cmdoptions
|
from pip._internal.cli import cmdoptions
|
||||||
from pip._internal.cli.parser import (
|
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
|
||||||
ConfigOptionParser,
|
|
||||||
UpdatingDefaultsHelpFormatter,
|
|
||||||
)
|
|
||||||
from pip._internal.commands import commands_dict, get_similar_commands
|
from pip._internal.commands import commands_dict, get_similar_commands
|
||||||
from pip._internal.exceptions import CommandError
|
from pip._internal.exceptions import CommandError
|
||||||
from pip._internal.utils.misc import get_pip_version, get_prog
|
from pip._internal.utils.misc import get_pip_version, get_prog
|
||||||
|
|
|
@ -38,10 +38,7 @@ if MYPY_CHECK_RUNNING:
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
from pip._internal.req.req_install import InstallRequirement
|
||||||
from pip._internal.req.req_tracker import RequirementTracker
|
from pip._internal.req.req_tracker import RequirementTracker
|
||||||
from pip._internal.resolution.base import BaseResolver
|
from pip._internal.resolution.base import BaseResolver
|
||||||
from pip._internal.utils.temp_dir import (
|
from pip._internal.utils.temp_dir import TempDirectory, TempDirectoryTypeRegistry
|
||||||
TempDirectory,
|
|
||||||
TempDirectoryTypeRegistry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -4,11 +4,7 @@ import subprocess
|
||||||
|
|
||||||
from pip._internal.cli.base_command import Command
|
from pip._internal.cli.base_command import Command
|
||||||
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
||||||
from pip._internal.configuration import (
|
from pip._internal.configuration import Configuration, get_configuration_files, kinds
|
||||||
Configuration,
|
|
||||||
get_configuration_files,
|
|
||||||
kinds,
|
|
||||||
)
|
|
||||||
from pip._internal.exceptions import PipError
|
from pip._internal.exceptions import PipError
|
||||||
from pip._internal.utils.logging import indent_log
|
from pip._internal.utils.logging import indent_log
|
||||||
from pip._internal.utils.misc import get_prog, write_output
|
from pip._internal.utils.misc import get_prog, write_output
|
||||||
|
|
|
@ -7,6 +7,7 @@ from collections import OrderedDict
|
||||||
|
|
||||||
from pip._vendor import pkg_resources
|
from pip._vendor import pkg_resources
|
||||||
from pip._vendor.packaging.version import parse as parse_version
|
from pip._vendor.packaging.version import parse as parse_version
|
||||||
|
|
||||||
# NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
|
# NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
|
||||||
# why we ignore the type on this import
|
# why we ignore the type on this import
|
||||||
from pip._vendor.six.moves import xmlrpc_client # type: ignore
|
from pip._vendor.six.moves import xmlrpc_client # type: ignore
|
||||||
|
|
|
@ -34,16 +34,7 @@ from pip._internal.utils.unpacking import SUPPORTED_EXTENSIONS
|
||||||
from pip._internal.utils.urls import url_to_path
|
from pip._internal.utils.urls import url_to_path
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import FrozenSet, Iterable, List, Optional, Set, Text, Tuple, Union
|
||||||
FrozenSet,
|
|
||||||
Iterable,
|
|
||||||
List,
|
|
||||||
Optional,
|
|
||||||
Set,
|
|
||||||
Text,
|
|
||||||
Tuple,
|
|
||||||
Union,
|
|
||||||
)
|
|
||||||
|
|
||||||
from pip._vendor.packaging.tags import Tag
|
from pip._vendor.packaging.tags import Tag
|
||||||
from pip._vendor.packaging.version import _BaseVersion
|
from pip._vendor.packaging.version import _BaseVersion
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from pip._internal.utils.compatibility_tags import (
|
from pip._internal.utils.compatibility_tags import get_supported, version_info_to_nodot
|
||||||
get_supported,
|
|
||||||
version_info_to_nodot,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.misc import normalize_version_info
|
from pip._internal.utils.misc import normalize_version_info
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,8 @@ from pip._internal.cli.progress_bars import DownloadProgressProvider
|
||||||
from pip._internal.exceptions import NetworkConnectionError
|
from pip._internal.exceptions import NetworkConnectionError
|
||||||
from pip._internal.models.index import PyPI
|
from pip._internal.models.index import PyPI
|
||||||
from pip._internal.network.cache import is_from_cache
|
from pip._internal.network.cache import is_from_cache
|
||||||
from pip._internal.network.utils import (
|
from pip._internal.network.utils import HEADERS, raise_for_status, response_chunks
|
||||||
HEADERS,
|
from pip._internal.utils.misc import format_size, redact_auth_from_url, splitext
|
||||||
raise_for_status,
|
|
||||||
response_chunks,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.misc import (
|
|
||||||
format_size,
|
|
||||||
redact_auth_from_url,
|
|
||||||
splitext,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
|
|
|
@ -10,11 +10,7 @@ from zipfile import BadZipfile, ZipFile
|
||||||
from pip._vendor.requests.models import CONTENT_CHUNK_SIZE
|
from pip._vendor.requests.models import CONTENT_CHUNK_SIZE
|
||||||
from pip._vendor.six.moves import range
|
from pip._vendor.six.moves import range
|
||||||
|
|
||||||
from pip._internal.network.utils import (
|
from pip._internal.network.utils import HEADERS, raise_for_status, response_chunks
|
||||||
HEADERS,
|
|
||||||
raise_for_status,
|
|
||||||
response_chunks,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel
|
from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ from pip._vendor.urllib3.exceptions import InsecureRequestWarning
|
||||||
from pip import __version__
|
from pip import __version__
|
||||||
from pip._internal.network.auth import MultiDomainBasicAuth
|
from pip._internal.network.auth import MultiDomainBasicAuth
|
||||||
from pip._internal.network.cache import SafeFileCache
|
from pip._internal.network.cache import SafeFileCache
|
||||||
|
|
||||||
# Import ssl from compat so the initial import occurs in only one place.
|
# Import ssl from compat so the initial import occurs in only one place.
|
||||||
from pip._internal.utils.compat import has_tls, ipaddress
|
from pip._internal.utils.compat import has_tls, ipaddress
|
||||||
from pip._internal.utils.glibc import libc_ver
|
from pip._internal.utils.glibc import libc_ver
|
||||||
|
|
|
@ -2,9 +2,7 @@ import logging
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
from pip._internal.cli.spinners import open_spinner
|
from pip._internal.cli.spinners import open_spinner
|
||||||
from pip._internal.utils.setuptools_build import (
|
from pip._internal.utils.setuptools_build import make_setuptools_bdist_wheel_args
|
||||||
make_setuptools_bdist_wheel_args,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.subprocess import (
|
from pip._internal.utils.subprocess import (
|
||||||
LOG_DIVIDER,
|
LOG_DIVIDER,
|
||||||
call_subprocess,
|
call_subprocess,
|
||||||
|
|
|
@ -7,9 +7,7 @@ from collections import namedtuple
|
||||||
from pip._vendor.packaging.utils import canonicalize_name
|
from pip._vendor.packaging.utils import canonicalize_name
|
||||||
from pip._vendor.pkg_resources import RequirementParseError
|
from pip._vendor.pkg_resources import RequirementParseError
|
||||||
|
|
||||||
from pip._internal.distributions import (
|
from pip._internal.distributions import make_distribution_for_install_requirement
|
||||||
make_distribution_for_install_requirement,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.misc import get_installed_distributions
|
from pip._internal.utils.misc import get_installed_distributions
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,7 @@ from pip._internal.utils.direct_url_helpers import (
|
||||||
direct_url_as_pep440_direct_reference,
|
direct_url_as_pep440_direct_reference,
|
||||||
dist_get_direct_url,
|
dist_get_direct_url,
|
||||||
)
|
)
|
||||||
from pip._internal.utils.misc import (
|
from pip._internal.utils.misc import dist_is_editable, get_installed_distributions
|
||||||
dist_is_editable,
|
|
||||||
get_installed_distributions,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
|
|
|
@ -21,14 +21,7 @@ from zipfile import ZipFile
|
||||||
from pip._vendor import pkg_resources
|
from pip._vendor import pkg_resources
|
||||||
from pip._vendor.distlib.scripts import ScriptMaker
|
from pip._vendor.distlib.scripts import ScriptMaker
|
||||||
from pip._vendor.distlib.util import get_export_entry
|
from pip._vendor.distlib.util import get_export_entry
|
||||||
from pip._vendor.six import (
|
from pip._vendor.six import PY2, ensure_str, ensure_text, itervalues, reraise, text_type
|
||||||
PY2,
|
|
||||||
ensure_str,
|
|
||||||
ensure_text,
|
|
||||||
itervalues,
|
|
||||||
reraise,
|
|
||||||
text_type,
|
|
||||||
)
|
|
||||||
from pip._vendor.six.moves import filterfalse, map
|
from pip._vendor.six.moves import filterfalse, map
|
||||||
|
|
||||||
from pip._internal.exceptions import InstallationError
|
from pip._internal.exceptions import InstallationError
|
||||||
|
@ -36,12 +29,7 @@ from pip._internal.locations import get_major_minor_version
|
||||||
from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, DirectUrl
|
from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, DirectUrl
|
||||||
from pip._internal.models.scheme import SCHEME_KEYS
|
from pip._internal.models.scheme import SCHEME_KEYS
|
||||||
from pip._internal.utils.filesystem import adjacent_tmp_file, replace
|
from pip._internal.utils.filesystem import adjacent_tmp_file, replace
|
||||||
from pip._internal.utils.misc import (
|
from pip._internal.utils.misc import captured_stdout, ensure_dir, hash_file, partition
|
||||||
captured_stdout,
|
|
||||||
ensure_dir,
|
|
||||||
hash_file,
|
|
||||||
partition,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.unpacking import (
|
from pip._internal.utils.unpacking import (
|
||||||
current_umask,
|
current_umask,
|
||||||
|
@ -49,10 +37,7 @@ from pip._internal.utils.unpacking import (
|
||||||
set_extracted_file_to_default_mode_plus_executable,
|
set_extracted_file_to_default_mode_plus_executable,
|
||||||
zip_item_is_executable,
|
zip_item_is_executable,
|
||||||
)
|
)
|
||||||
from pip._internal.utils.wheel import (
|
from pip._internal.utils.wheel import parse_wheel, pkg_resources_distribution_for_wheel
|
||||||
parse_wheel,
|
|
||||||
pkg_resources_distribution_for_wheel,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Use the custom cast function at runtime to make cast work,
|
# Use the custom cast function at runtime to make cast work,
|
||||||
# and import typing.cast when performing pre-commit and type
|
# and import typing.cast when performing pre-commit and type
|
||||||
|
|
|
@ -12,9 +12,7 @@ import shutil
|
||||||
from pip._vendor.packaging.utils import canonicalize_name
|
from pip._vendor.packaging.utils import canonicalize_name
|
||||||
from pip._vendor.six import PY2
|
from pip._vendor.six import PY2
|
||||||
|
|
||||||
from pip._internal.distributions import (
|
from pip._internal.distributions import make_distribution_for_install_requirement
|
||||||
make_distribution_for_install_requirement,
|
|
||||||
)
|
|
||||||
from pip._internal.distributions.installed import InstalledDistribution
|
from pip._internal.distributions.installed import InstalledDistribution
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import (
|
||||||
DirectoryUrlHashUnsupported,
|
DirectoryUrlHashUnsupported,
|
||||||
|
@ -34,12 +32,7 @@ from pip._internal.network.lazy_wheel import (
|
||||||
from pip._internal.utils.filesystem import copy2_fixed
|
from pip._internal.utils.filesystem import copy2_fixed
|
||||||
from pip._internal.utils.hashes import MissingHashes
|
from pip._internal.utils.hashes import MissingHashes
|
||||||
from pip._internal.utils.logging import indent_log
|
from pip._internal.utils.logging import indent_log
|
||||||
from pip._internal.utils.misc import (
|
from pip._internal.utils.misc import display_path, hide_url, path_to_display, rmtree
|
||||||
display_path,
|
|
||||||
hide_url,
|
|
||||||
path_to_display,
|
|
||||||
rmtree,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.temp_dir import TempDirectory
|
from pip._internal.utils.temp_dir import TempDirectory
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from pip._internal.utils.unpacking import unpack_file
|
from pip._internal.utils.unpacking import unpack_file
|
||||||
|
|
|
@ -13,10 +13,7 @@ import sys
|
||||||
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
||||||
|
|
||||||
from pip._internal.cli import cmdoptions
|
from pip._internal.cli import cmdoptions
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import InstallationError, RequirementsFileParseError
|
||||||
InstallationError,
|
|
||||||
RequirementsFileParseError,
|
|
||||||
)
|
|
||||||
from pip._internal.models.search_scope import SearchScope
|
from pip._internal.models.search_scope import SearchScope
|
||||||
from pip._internal.network.utils import raise_for_status
|
from pip._internal.network.utils import raise_for_status
|
||||||
from pip._internal.utils.encoding import auto_decode
|
from pip._internal.utils.encoding import auto_decode
|
||||||
|
|
|
@ -22,10 +22,12 @@ from pip._internal.exceptions import InstallationError
|
||||||
from pip._internal.locations import get_scheme
|
from pip._internal.locations import get_scheme
|
||||||
from pip._internal.models.link import Link
|
from pip._internal.models.link import Link
|
||||||
from pip._internal.operations.build.metadata import generate_metadata
|
from pip._internal.operations.build.metadata import generate_metadata
|
||||||
from pip._internal.operations.build.metadata_legacy import \
|
from pip._internal.operations.build.metadata_legacy import (
|
||||||
generate_metadata as generate_metadata_legacy
|
generate_metadata as generate_metadata_legacy,
|
||||||
from pip._internal.operations.install.editable_legacy import \
|
)
|
||||||
install_editable as install_editable_legacy
|
from pip._internal.operations.install.editable_legacy import (
|
||||||
|
install_editable as install_editable_legacy,
|
||||||
|
)
|
||||||
from pip._internal.operations.install.legacy import LegacyInstallFailure
|
from pip._internal.operations.install.legacy import LegacyInstallFailure
|
||||||
from pip._internal.operations.install.legacy import install as install_legacy
|
from pip._internal.operations.install.legacy import install as install_legacy
|
||||||
from pip._internal.operations.install.wheel import install_wheel
|
from pip._internal.operations.install.wheel import install_wheel
|
||||||
|
|
|
@ -34,10 +34,7 @@ from pip._internal.resolution.base import BaseResolver
|
||||||
from pip._internal.utils.compatibility_tags import get_supported
|
from pip._internal.utils.compatibility_tags import get_supported
|
||||||
from pip._internal.utils.logging import indent_log
|
from pip._internal.utils.logging import indent_log
|
||||||
from pip._internal.utils.misc import dist_in_usersite, normalize_version_info
|
from pip._internal.utils.misc import dist_in_usersite, normalize_version_info
|
||||||
from pip._internal.utils.packaging import (
|
from pip._internal.utils.packaging import check_requires_python, get_requires_python
|
||||||
check_requires_python,
|
|
||||||
get_requires_python,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
|
|
|
@ -5,16 +5,7 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
from .base import Constraint
|
from .base import Constraint
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Dict, Iterable, Optional, Sequence, Set, Tuple, Union
|
||||||
Any,
|
|
||||||
Dict,
|
|
||||||
Iterable,
|
|
||||||
Optional,
|
|
||||||
Sequence,
|
|
||||||
Set,
|
|
||||||
Tuple,
|
|
||||||
Union,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .base import Candidate, Requirement
|
from .base import Candidate, Requirement
|
||||||
from .factory import Factory
|
from .factory import Factory
|
||||||
|
|
|
@ -13,16 +13,8 @@ from pip._vendor.six import ensure_binary
|
||||||
from pip._internal.index.collector import LinkCollector
|
from pip._internal.index.collector import LinkCollector
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
from pip._internal.models.selection_prefs import SelectionPreferences
|
from pip._internal.models.selection_prefs import SelectionPreferences
|
||||||
from pip._internal.utils.filesystem import (
|
from pip._internal.utils.filesystem import adjacent_tmp_file, check_path_owner, replace
|
||||||
adjacent_tmp_file,
|
from pip._internal.utils.misc import ensure_dir, get_distribution, get_installed_version
|
||||||
check_path_owner,
|
|
||||||
replace,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.misc import (
|
|
||||||
ensure_dir,
|
|
||||||
get_distribution,
|
|
||||||
get_installed_version,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.packaging import get_installer
|
from pip._internal.utils.packaging import get_installer
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,7 @@ import hashlib
|
||||||
|
|
||||||
from pip._vendor.six import iteritems, iterkeys, itervalues
|
from pip._vendor.six import iteritems, iterkeys, itervalues
|
||||||
|
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import HashMismatch, HashMissing, InstallationError
|
||||||
HashMismatch,
|
|
||||||
HashMissing,
|
|
||||||
InstallationError,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.misc import read_chunks
|
from pip._internal.utils.misc import read_chunks
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ from itertools import tee
|
||||||
|
|
||||||
from pip._vendor import pkg_resources
|
from pip._vendor import pkg_resources
|
||||||
from pip._vendor.packaging.utils import canonicalize_name
|
from pip._vendor.packaging.utils import canonicalize_name
|
||||||
|
|
||||||
# NOTE: retrying is not annotated in typeshed as on 2017-07-17, which is
|
# NOTE: retrying is not annotated in typeshed as on 2017-07-17, which is
|
||||||
# why we ignore the type on this import.
|
# why we ignore the type on this import.
|
||||||
from pip._vendor.retrying import retry # type: ignore
|
from pip._vendor.retrying import retry # type: ignore
|
||||||
|
@ -30,17 +31,8 @@ from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote
|
||||||
|
|
||||||
from pip import __version__
|
from pip import __version__
|
||||||
from pip._internal.exceptions import CommandError
|
from pip._internal.exceptions import CommandError
|
||||||
from pip._internal.locations import (
|
from pip._internal.locations import get_major_minor_version, site_packages, user_site
|
||||||
get_major_minor_version,
|
from pip._internal.utils.compat import WINDOWS, expanduser, stdlib_pkgs, str_to_display
|
||||||
site_packages,
|
|
||||||
user_site,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.compat import (
|
|
||||||
WINDOWS,
|
|
||||||
expanduser,
|
|
||||||
stdlib_pkgs,
|
|
||||||
str_to_display,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING, cast
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING, cast
|
||||||
from pip._internal.utils.virtualenv import (
|
from pip._internal.utils.virtualenv import (
|
||||||
running_under_virtualenv,
|
running_under_virtualenv,
|
||||||
|
|
|
@ -14,16 +14,7 @@ from pip._internal.utils.misc import HiddenText, path_to_display
|
||||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
|
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import (
|
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Union
|
||||||
Any,
|
|
||||||
Callable,
|
|
||||||
Iterable,
|
|
||||||
List,
|
|
||||||
Mapping,
|
|
||||||
Optional,
|
|
||||||
Text,
|
|
||||||
Union,
|
|
||||||
)
|
|
||||||
|
|
||||||
CommandArgs = List[Union[str, HiddenText]]
|
CommandArgs = List[Union[str, HiddenText]]
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,7 @@ import sys
|
||||||
from pip._vendor import pkg_resources
|
from pip._vendor import pkg_resources
|
||||||
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
||||||
|
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import BadCommand, InstallationError, SubProcessError
|
||||||
BadCommand,
|
|
||||||
InstallationError,
|
|
||||||
SubProcessError,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.compat import console_to_str, samefile
|
from pip._internal.utils.compat import console_to_str, samefile
|
||||||
from pip._internal.utils.logging import subprocess_logger
|
from pip._internal.utils.logging import subprocess_logger
|
||||||
from pip._internal.utils.misc import (
|
from pip._internal.utils.misc import (
|
||||||
|
|
|
@ -7,10 +7,7 @@ import textwrap
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pip._internal.cli.status_codes import ERROR
|
from pip._internal.cli.status_codes import ERROR
|
||||||
from pip._internal.configuration import (
|
from pip._internal.configuration import CONFIG_BASENAME, get_configuration_files
|
||||||
CONFIG_BASENAME,
|
|
||||||
get_configuration_files,
|
|
||||||
)
|
|
||||||
from tests.lib.configuration_helpers import ConfigurationMixin, kinds
|
from tests.lib.configuration_helpers import ConfigurationMixin, kinds
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,7 @@ import hashlib
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pip._internal.utils.urls import path_to_url
|
from pip._internal.utils.urls import path_to_url
|
||||||
from tests.lib import (
|
from tests.lib import create_basic_sdist_for_package, create_basic_wheel_for_package
|
||||||
create_basic_sdist_for_package,
|
|
||||||
create_basic_wheel_for_package,
|
|
||||||
)
|
|
||||||
|
|
||||||
_FindLinks = collections.namedtuple(
|
_FindLinks = collections.namedtuple(
|
||||||
"_FindLinks", "index_html sdist_hash wheel_hash",
|
"_FindLinks", "index_html sdist_hash wheel_hash",
|
||||||
|
|
|
@ -5,11 +5,7 @@ import pytest
|
||||||
|
|
||||||
from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS
|
from pip._internal.cli.status_codes import NO_MATCHES_FOUND, SUCCESS
|
||||||
from pip._internal.commands import create_command
|
from pip._internal.commands import create_command
|
||||||
from pip._internal.commands.search import (
|
from pip._internal.commands.search import highest_version, print_results, transform_hits
|
||||||
highest_version,
|
|
||||||
print_results,
|
|
||||||
transform_hits,
|
|
||||||
)
|
|
||||||
from tests.lib import pyversion
|
from tests.lib import pyversion
|
||||||
|
|
||||||
if pyversion >= '3':
|
if pyversion >= '3':
|
||||||
|
|
|
@ -13,11 +13,7 @@ import pytest
|
||||||
|
|
||||||
from pip._internal.req.constructors import install_req_from_line
|
from pip._internal.req.constructors import install_req_from_line
|
||||||
from pip._internal.utils.misc import rmtree
|
from pip._internal.utils.misc import rmtree
|
||||||
from tests.lib import (
|
from tests.lib import assert_all_changes, create_test_package_with_setup, need_svn
|
||||||
assert_all_changes,
|
|
||||||
create_test_package_with_setup,
|
|
||||||
need_svn,
|
|
||||||
)
|
|
||||||
from tests.lib.local_repos import local_checkout, local_repo
|
from tests.lib.local_repos import local_checkout, local_repo
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ from pip._internal.cli.req_command import RequirementCommand
|
||||||
from pip._internal.commands.install import InstallCommand
|
from pip._internal.commands.install import InstallCommand
|
||||||
from pip._internal.index.collector import LinkCollector
|
from pip._internal.index.collector import LinkCollector
|
||||||
from pip._internal.index.package_finder import PackageFinder
|
from pip._internal.index.package_finder import PackageFinder
|
||||||
|
|
||||||
# from pip._internal.models.index import PyPI
|
# from pip._internal.models.index import PyPI
|
||||||
from pip._internal.models.search_scope import SearchScope
|
from pip._internal.models.search_scope import SearchScope
|
||||||
from pip._internal.models.selection_prefs import SelectionPreferences
|
from pip._internal.models.selection_prefs import SelectionPreferences
|
||||||
|
|
|
@ -8,10 +8,7 @@ from pip._vendor.packaging.tags import Tag
|
||||||
from pkg_resources import parse_version
|
from pkg_resources import parse_version
|
||||||
|
|
||||||
import pip._internal.utils.compatibility_tags
|
import pip._internal.utils.compatibility_tags
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import BestVersionAlreadyInstalled, DistributionNotFound
|
||||||
BestVersionAlreadyInstalled,
|
|
||||||
DistributionNotFound,
|
|
||||||
)
|
|
||||||
from pip._internal.index.package_finder import (
|
from pip._internal.index.package_finder import (
|
||||||
CandidateEvaluator,
|
CandidateEvaluator,
|
||||||
InstallationCandidate,
|
InstallationCandidate,
|
||||||
|
|
|
@ -13,11 +13,7 @@ from pip._internal.network.session import PipSession
|
||||||
from pip._internal.operations.prepare import _copy_source_tree, unpack_url
|
from pip._internal.operations.prepare import _copy_source_tree, unpack_url
|
||||||
from pip._internal.utils.hashes import Hashes
|
from pip._internal.utils.hashes import Hashes
|
||||||
from pip._internal.utils.urls import path_to_url
|
from pip._internal.utils.urls import path_to_url
|
||||||
from tests.lib.filesystem import (
|
from tests.lib.filesystem import get_filelist, make_socket_file, make_unreadable_file
|
||||||
get_filelist,
|
|
||||||
make_socket_file,
|
|
||||||
make_unreadable_file,
|
|
||||||
)
|
|
||||||
from tests.lib.path import Path
|
from tests.lib.path import Path
|
||||||
from tests.lib.requests_mocks import MockResponse
|
from tests.lib.requests_mocks import MockResponse
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,7 @@ from pip._vendor.six import PY2
|
||||||
from pretend import stub
|
from pretend import stub
|
||||||
|
|
||||||
import pip._internal.req.req_file # this will be monkeypatched
|
import pip._internal.req.req_file # this will be monkeypatched
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import InstallationError, RequirementsFileParseError
|
||||||
InstallationError,
|
|
||||||
RequirementsFileParseError,
|
|
||||||
)
|
|
||||||
from pip._internal.models.format_control import FormatControl
|
from pip._internal.models.format_control import FormatControl
|
||||||
from pip._internal.network.session import PipSession
|
from pip._internal.network.session import PipSession
|
||||||
from pip._internal.req.constructors import (
|
from pip._internal.req.constructors import (
|
||||||
|
|
|
@ -4,10 +4,7 @@ import mock
|
||||||
import pytest
|
import pytest
|
||||||
from pip._vendor import pkg_resources
|
from pip._vendor import pkg_resources
|
||||||
|
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import NoneMetadataError, UnsupportedPythonVersion
|
||||||
NoneMetadataError,
|
|
||||||
UnsupportedPythonVersion,
|
|
||||||
)
|
|
||||||
from pip._internal.req.constructors import install_req_from_line
|
from pip._internal.req.constructors import install_req_from_line
|
||||||
from pip._internal.resolution.legacy.resolver import (
|
from pip._internal.resolution.legacy.resolver import (
|
||||||
Resolver,
|
Resolver,
|
||||||
|
|
|
@ -16,11 +16,7 @@ from io import BytesIO
|
||||||
import pytest
|
import pytest
|
||||||
from mock import Mock, patch
|
from mock import Mock, patch
|
||||||
|
|
||||||
from pip._internal.exceptions import (
|
from pip._internal.exceptions import HashMismatch, HashMissing, InstallationError
|
||||||
HashMismatch,
|
|
||||||
HashMissing,
|
|
||||||
InstallationError,
|
|
||||||
)
|
|
||||||
from pip._internal.utils.deprecation import PipDeprecationWarning, deprecated
|
from pip._internal.utils.deprecation import PipDeprecationWarning, deprecated
|
||||||
from pip._internal.utils.encoding import BOMS, auto_decode
|
from pip._internal.utils.encoding import BOMS, auto_decode
|
||||||
from pip._internal.utils.glibc import (
|
from pip._internal.utils.glibc import (
|
||||||
|
|
|
@ -10,11 +10,7 @@ import zipfile
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pip._internal.exceptions import InstallationError
|
from pip._internal.exceptions import InstallationError
|
||||||
from pip._internal.utils.unpacking import (
|
from pip._internal.utils.unpacking import is_within_directory, untar_file, unzip_file
|
||||||
is_within_directory,
|
|
||||||
untar_file,
|
|
||||||
unzip_file,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestUnpackArchives(object):
|
class TestUnpackArchives(object):
|
||||||
|
|
|
@ -19,9 +19,7 @@ from pip._internal.models.direct_url import (
|
||||||
DirectUrl,
|
DirectUrl,
|
||||||
)
|
)
|
||||||
from pip._internal.models.scheme import Scheme
|
from pip._internal.models.scheme import Scheme
|
||||||
from pip._internal.operations.build.wheel_legacy import (
|
from pip._internal.operations.build.wheel_legacy import get_legacy_build_wheel_path
|
||||||
get_legacy_build_wheel_path,
|
|
||||||
)
|
|
||||||
from pip._internal.operations.install import wheel
|
from pip._internal.operations.install import wheel
|
||||||
from pip._internal.utils.compat import WINDOWS
|
from pip._internal.utils.compat import WINDOWS
|
||||||
from pip._internal.utils.misc import hash_file
|
from pip._internal.utils.misc import hash_file
|
||||||
|
|
Loading…
Reference in New Issue