1- # -*- coding=utf-8 -*-
2-
31import atexit
42import contextlib
53import copy
64import functools
75import os
8- from contextlib import ExitStack
96from json import JSONDecodeError
107
118import pipenv .vendor .attr as attr
129import pipenv .patched .pip ._vendor .requests as requests
13- from pipenv .patched .pip ._vendor .packaging .markers import Marker
14- from pipenv .patched .pip ._vendor .packaging .utils import canonicalize_name
15- from pipenv .patched .pip ._vendor .packaging .version import parse
1610from pipenv .patched .pip ._internal .cache import WheelCache
1711from pipenv .patched .pip ._internal .models .format_control import FormatControl
1812from pipenv .patched .pip ._internal .operations .build .build_tracker import get_build_tracker
1913from pipenv .patched .pip ._internal .req .constructors import install_req_from_line
2014from pipenv .patched .pip ._internal .req .req_install import InstallRequirement
2115from pipenv .patched .pip ._internal .req .req_set import RequirementSet
2216from pipenv .patched .pip ._internal .utils .temp_dir import TempDirectory , global_tempdir_manager
17+ from pipenv .patched .pip ._vendor .packaging .markers import Marker
18+ from pipenv .patched .pip ._vendor .packaging .utils import canonicalize_name
19+ from pipenv .patched .pip ._vendor .packaging .version import parse
2320from pipenv .vendor .vistir .compat import fs_str
2421from pipenv .vendor .vistir .contextmanagers import temp_environ
2522from pipenv .vendor .vistir .path import create_tracked_tempdir
3532from .setup_info import SetupInfo
3633from .utils import (
3734 clean_requires_python ,
38- fix_requires_python_marker ,
3935 format_requirement ,
4036 full_groupby ,
4137 is_pinned_requirement ,
4642)
4743
4844if MYPY_RUNNING :
49- from typing import (
50- Any ,
51- Dict ,
52- Generator ,
53- List ,
54- Optional ,
55- Set ,
56- Text ,
57- Tuple ,
58- TypeVar ,
59- Union ,
60- )
45+ from typing import Any , Dict , List , Optional , Set , Text , TypeVar , Union
6146
62- from pipenv .patched .pip ._vendor .packaging .requirements import Requirement as PackagingRequirement
63- from pipenv .patched .pip ._internal .commands .base_command import Command
47+ from pipenv .patched .pip ._internal .commands import Command
6448 from pipenv .patched .pip ._internal .index .package_finder import PackageFinder
6549 from pipenv .patched .pip ._internal .models .candidate import InstallationCandidate
50+ from pipenv .patched .pip ._vendor .packaging .requirements import Requirement as PackagingRequirement
6651
6752 TRequirement = TypeVar ("TRequirement" )
6853 RequirementType = TypeVar (
@@ -95,11 +80,11 @@ def find_all_matches(finder, ireq, pre=False):
9580 ireq.
9681
9782 :param finder: A package finder for discovering matching candidates.
98- :type finder: :class:`~pipenv.patched. pip._internal.index.PackageFinder`
83+ :type finder: :class:`~pip._internal.index.PackageFinder`
9984 :param ireq: An install requirement.
100- :type ireq: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
85+ :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
10186 :return: A list of matching candidates.
102- :rtype: list[:class:`~pipenv.patched. pip._internal.index.InstallationCandidate`]
87+ :rtype: list[:class:`~pip._internal.index.InstallationCandidate`]
10388 """
10489
10590 candidates = clean_requires_python (finder .find_all_candidates (ireq .name ))
@@ -207,7 +192,7 @@ def get_deps(self, candidate):
207192 """Get the dependencies of the supplied candidate.
208193
209194 :param candidate: An installrequirement
210- :type candidate: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
195+ :type candidate: :class:`~pip._internal.req.req_install.InstallRequirement`
211196 :return: A list of abstract dependencies
212197 :rtype: list[:class:`~requirementslib.models.dependency.AbstractDependency`]
213198 """
@@ -316,11 +301,11 @@ def get_dependencies(ireq, sources=None, parent=None):
316301 """Get all dependencies for a given install requirement.
317302
318303 :param ireq: A single InstallRequirement
319- :type ireq: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
304+ :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
320305 :param sources: Pipfile-formatted sources, defaults to None
321306 :type sources: list[dict], optional
322307 :param parent: The parent of this list of dependencies, defaults to None
323- :type parent: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
308+ :type parent: :class:`~pip._internal.req.req_install.InstallRequirement`
324309 :return: A set of dependency lines for generating new InstallRequirements.
325310 :rtype: set(str)
326311 """
@@ -350,7 +335,7 @@ def get_dependencies_from_wheel_cache(ireq):
350335 cache.
351336
352337 :param ireq: A single InstallRequirement
353- :type ireq: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
338+ :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
354339 :return: A set of dependency lines for generating new InstallRequirements.
355340 :rtype: set(str) or None
356341 """
@@ -377,7 +362,7 @@ def get_dependencies_from_json(ireq):
377362 api.
378363
379364 :param ireq: A single InstallRequirement
380- :type ireq: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
365+ :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
381366 :return: A set of dependency lines for generating new InstallRequirements.
382367 :rtype: set(str) or None
383368 """
@@ -427,7 +412,7 @@ def get_dependencies_from_cache(ireq):
427412 dependency cache.
428413
429414 :param ireq: A single InstallRequirement
430- :type ireq: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
415+ :type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
431416 :return: A set of dependency lines for generating new InstallRequirements.
432417 :rtype: set(str) or None
433418 """
@@ -531,7 +516,7 @@ def get_dependencies_from_index(dep, sources=None, pip_options=None, wheel_cache
531516 resolver.
532517
533518 :param dep: A single InstallRequirement
534- :type dep: :class:`~pipenv.patched. pip._internal.req.req_install.InstallRequirement`
519+ :type dep: :class:`~pip._internal.req.req_install.InstallRequirement`
535520 :param sources: Pipfile-formatted sources, defaults to None
536521 :type sources: list[dict], optional
537522 :return: A set of dependency lines for generating new InstallRequirements.
@@ -570,9 +555,9 @@ def get_pip_options(args=None, sources=None, pip_command=None):
570555 :param sources: A list of pipfile-formatted sources, defaults to None
571556 :param sources: list[dict], optional
572557 :param pip_command: A pre-built pip command instance
573- :type pip_command: :class:`~pipenv.patched. pip._internal.cli.base_command.Command`
558+ :type pip_command: :class:`~pip._internal.cli.base_command.Command`
574559 :return: An instance of pip_options using the supplied arguments plus sane defaults
575- :rtype: :class:`~pipenv.patched. pip._internal.cli.cmdoptions`
560+ :rtype: :class:`~pip._internal.cli.cmdoptions`
576561 """
577562
578563 if not pip_command :
@@ -594,11 +579,11 @@ def get_finder(sources=None, pip_command=None, pip_options=None):
594579 :param sources: A list of pipfile-formatted sources, defaults to None
595580 :param sources: list[dict], optional
596581 :param pip_command: A pip command instance, defaults to None
597- :type pip_command: :class:`~pipenv.patched. pip._internal.cli.base_command.Command`
582+ :type pip_command: :class:`~pip._internal.cli.base_command.Command`
598583 :param pip_options: A pip options, defaults to None
599- :type pip_options: :class:`~pipenv.patched. pip._internal.cli.cmdoptions`
584+ :type pip_options: :class:`~pip._internal.cli.cmdoptions`
600585 :return: A package finder
601- :rtype: :class:`~pipenv.patched. pip._internal.index.PackageFinder`
586+ :rtype: :class:`~pip._internal.index.PackageFinder`
602587 """
603588
604589 if not pip_command :
@@ -618,12 +603,12 @@ def start_resolver(finder=None, session=None, wheel_cache=None):
618603 """Context manager to produce a resolver.
619604
620605 :param finder: A package finder to use for searching the index
621- :type finder: :class:`~pipenv.patched. pip._internal.index.PackageFinder`
606+ :type finder: :class:`~pip._internal.index.PackageFinder`
622607 :param :class:`~requests.Session` session: A session instance
623- :param :class:`~pipenv.patched. pip._internal.cache.WheelCache` wheel_cache: A pip WheelCache instance
608+ :param :class:`~pip._internal.cache.WheelCache` wheel_cache: A pip WheelCache instance
624609 :return: A 3-tuple of finder, preparer, resolver
625- :rtype: (:class:`~pipenv.patched. pip._internal.operations.prepare.RequirementPreparer`,
626- :class:`~pipenv.patched. pip._internal.resolve.Resolver`)
610+ :rtype: (:class:`~pip._internal.operations.prepare.RequirementPreparer`,
611+ :class:`~pip._internal.resolve.Resolver`)
627612 """
628613
629614 pip_command = get_pip_command ()
0 commit comments