mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Vendor in requirementslib 2.0.2
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ from .models.lockfile import Lockfile
|
||||
from .models.pipfile import Pipfile
|
||||
from .models.requirements import Requirement
|
||||
|
||||
__version__ = "2.0.2.dev0"
|
||||
__version__ = "2.0.2"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
# -*- coding=utf-8 -*-
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
|
||||
from pipenv.vendor.platformdirs import user_cache_dir
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ class HashCache(DictCache):
|
||||
def __init__(self, *args, **kwargs):
|
||||
session = kwargs.pop("session", None)
|
||||
if not session:
|
||||
import requests
|
||||
import pipenv.patched.pip._vendor.requests as requests
|
||||
|
||||
session = requests.session()
|
||||
atexit.register(session.close)
|
||||
|
||||
+19
-19
@@ -80,11 +80,11 @@ def find_all_matches(finder, ireq, pre=False):
|
||||
ireq.
|
||||
|
||||
:param finder: A package finder for discovering matching candidates.
|
||||
:type finder: :class:`~pip._internal.index.PackageFinder`
|
||||
:type finder: :class:`~pipenv.patched.pip._internal.index.PackageFinder`
|
||||
:param ireq: An install requirement.
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A list of matching candidates.
|
||||
:rtype: list[:class:`~pip._internal.index.InstallationCandidate`]
|
||||
:rtype: list[:class:`~pipenv.patched.pip._internal.index.InstallationCandidate`]
|
||||
"""
|
||||
|
||||
candidates = clean_requires_python(finder.find_all_candidates(ireq.name))
|
||||
@@ -192,7 +192,7 @@ class AbstractDependency(object):
|
||||
"""Get the dependencies of the supplied candidate.
|
||||
|
||||
:param candidate: An installrequirement
|
||||
:type candidate: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type candidate: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A list of abstract dependencies
|
||||
:rtype: list[:class:`~requirementslib.models.dependency.AbstractDependency`]
|
||||
"""
|
||||
@@ -301,11 +301,11 @@ def get_dependencies(ireq, sources=None, parent=None):
|
||||
"""Get all dependencies for a given install requirement.
|
||||
|
||||
:param ireq: A single InstallRequirement
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:param sources: Pipfile-formatted sources, defaults to None
|
||||
:type sources: list[dict], optional
|
||||
:param parent: The parent of this list of dependencies, defaults to None
|
||||
:type parent: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type parent: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A set of dependency lines for generating new InstallRequirements.
|
||||
:rtype: set(str)
|
||||
"""
|
||||
@@ -335,7 +335,7 @@ def get_dependencies_from_wheel_cache(ireq):
|
||||
cache.
|
||||
|
||||
:param ireq: A single InstallRequirement
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A set of dependency lines for generating new InstallRequirements.
|
||||
:rtype: set(str) or None
|
||||
"""
|
||||
@@ -362,7 +362,7 @@ def get_dependencies_from_json(ireq):
|
||||
api.
|
||||
|
||||
:param ireq: A single InstallRequirement
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A set of dependency lines for generating new InstallRequirements.
|
||||
:rtype: set(str) or None
|
||||
"""
|
||||
@@ -412,7 +412,7 @@ def get_dependencies_from_cache(ireq):
|
||||
dependency cache.
|
||||
|
||||
:param ireq: A single InstallRequirement
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: A set of dependency lines for generating new InstallRequirements.
|
||||
:rtype: set(str) or None
|
||||
"""
|
||||
@@ -516,7 +516,7 @@ def get_dependencies_from_index(dep, sources=None, pip_options=None, wheel_cache
|
||||
resolver.
|
||||
|
||||
:param dep: A single InstallRequirement
|
||||
:type dep: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type dep: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:param sources: Pipfile-formatted sources, defaults to None
|
||||
:type sources: list[dict], optional
|
||||
:return: A set of dependency lines for generating new InstallRequirements.
|
||||
@@ -555,9 +555,9 @@ def get_pip_options(args=None, sources=None, pip_command=None):
|
||||
:param sources: A list of pipfile-formatted sources, defaults to None
|
||||
:param sources: list[dict], optional
|
||||
:param pip_command: A pre-built pip command instance
|
||||
:type pip_command: :class:`~pip._internal.cli.base_command.Command`
|
||||
:type pip_command: :class:`~pipenv.patched.pip._internal.cli.base_command.Command`
|
||||
:return: An instance of pip_options using the supplied arguments plus sane defaults
|
||||
:rtype: :class:`~pip._internal.cli.cmdoptions`
|
||||
:rtype: :class:`~pipenv.patched.pip._internal.cli.cmdoptions`
|
||||
"""
|
||||
|
||||
if not pip_command:
|
||||
@@ -579,11 +579,11 @@ def get_finder(sources=None, pip_command=None, pip_options=None):
|
||||
:param sources: A list of pipfile-formatted sources, defaults to None
|
||||
:param sources: list[dict], optional
|
||||
:param pip_command: A pip command instance, defaults to None
|
||||
:type pip_command: :class:`~pip._internal.cli.base_command.Command`
|
||||
:type pip_command: :class:`~pipenv.patched.pip._internal.cli.base_command.Command`
|
||||
:param pip_options: A pip options, defaults to None
|
||||
:type pip_options: :class:`~pip._internal.cli.cmdoptions`
|
||||
:type pip_options: :class:`~pipenv.patched.pip._internal.cli.cmdoptions`
|
||||
:return: A package finder
|
||||
:rtype: :class:`~pip._internal.index.PackageFinder`
|
||||
:rtype: :class:`~pipenv.patched.pip._internal.index.PackageFinder`
|
||||
"""
|
||||
|
||||
if not pip_command:
|
||||
@@ -603,12 +603,12 @@ def start_resolver(finder=None, session=None, wheel_cache=None):
|
||||
"""Context manager to produce a resolver.
|
||||
|
||||
:param finder: A package finder to use for searching the index
|
||||
:type finder: :class:`~pip._internal.index.PackageFinder`
|
||||
:type finder: :class:`~pipenv.patched.pip._internal.index.PackageFinder`
|
||||
:param :class:`~requests.Session` session: A session instance
|
||||
:param :class:`~pip._internal.cache.WheelCache` wheel_cache: A pip WheelCache instance
|
||||
:param :class:`~pipenv.patched.pip._internal.cache.WheelCache` wheel_cache: A pip WheelCache instance
|
||||
:return: A 3-tuple of finder, preparer, resolver
|
||||
:rtype: (:class:`~pip._internal.operations.prepare.RequirementPreparer`,
|
||||
:class:`~pip._internal.resolve.Resolver`)
|
||||
:rtype: (:class:`~pipenv.patched.pip._internal.operations.prepare.RequirementPreparer`,
|
||||
:class:`~pipenv.patched.pip._internal.resolve.Resolver`)
|
||||
"""
|
||||
|
||||
pip_command = get_pip_command()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import copy
|
||||
import itertools
|
||||
import os
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ if MYPY_RUNNING:
|
||||
Union,
|
||||
)
|
||||
|
||||
from attr import Attribute # noqa
|
||||
from pipenv.vendor.attr import Attribute # noqa
|
||||
|
||||
from .setup_info import SetupInfo
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import copy
|
||||
import itertools
|
||||
import os
|
||||
|
||||
+1
-5
@@ -1,7 +1,3 @@
|
||||
# -*- coding=utf-8 -*-
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import collections
|
||||
import io
|
||||
import os
|
||||
@@ -135,7 +131,7 @@ class Project(object):
|
||||
)
|
||||
|
||||
def add_line_to_pipfile(self, line, develop):
|
||||
from requirementslib import Requirement
|
||||
from pipenv.vendor.requirementslib import Requirement
|
||||
|
||||
requirement = Requirement.from_line(line)
|
||||
section = self._get_pipfile_section(develop=develop)
|
||||
|
||||
+12
-12
@@ -11,16 +11,6 @@ from urllib.parse import unquote
|
||||
|
||||
import pipenv.vendor.attr as attr
|
||||
from pipenv.vendor.pyparsing.core import cached_property
|
||||
from pipenv.patched.pip._vendor.packaging.markers import Marker
|
||||
from pipenv.patched.pip._vendor.packaging.requirements import Requirement as PackagingRequirement
|
||||
from pipenv.patched.pip._vendor.packaging.specifiers import (
|
||||
InvalidSpecifier,
|
||||
LegacySpecifier,
|
||||
Specifier,
|
||||
SpecifierSet,
|
||||
)
|
||||
from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
|
||||
from pipenv.patched.pip._vendor.packaging.version import parse
|
||||
from pipenv.patched.pip._internal.models.link import Link
|
||||
from pipenv.patched.pip._internal.models.wheel import Wheel
|
||||
from pipenv.patched.pip._internal.req.constructors import (
|
||||
@@ -31,6 +21,16 @@ from pipenv.patched.pip._internal.req.constructors import (
|
||||
from pipenv.patched.pip._internal.req.req_install import InstallRequirement
|
||||
from pipenv.patched.pip._internal.utils.temp_dir import global_tempdir_manager
|
||||
from pipenv.patched.pip._internal.utils.urls import path_to_url, url_to_path
|
||||
from pipenv.patched.pip._vendor.packaging.markers import Marker
|
||||
from pipenv.patched.pip._vendor.packaging.requirements import Requirement as PackagingRequirement
|
||||
from pipenv.patched.pip._vendor.packaging.specifiers import (
|
||||
InvalidSpecifier,
|
||||
LegacySpecifier,
|
||||
Specifier,
|
||||
SpecifierSet,
|
||||
)
|
||||
from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
|
||||
from pipenv.patched.pip._vendor.packaging.version import parse
|
||||
from pipenv.vendor.vistir.contextmanagers import temp_path
|
||||
from pipenv.vendor.vistir.misc import dedup
|
||||
from pipenv.vendor.vistir.path import (
|
||||
@@ -1466,7 +1466,7 @@ class FileRequirement(object):
|
||||
forward slashes. Can be None if the line is a remote URI.
|
||||
- `uri` is the absolute URI to the package. Can be None if the line is
|
||||
not a URI.
|
||||
- `link` is an instance of :class:`pip._internal.index.Link`,
|
||||
- `link` is an instance of :class:`pipenv.patched.pip._internal.index.Link`,
|
||||
representing a URI parse result based on the value of `uri`.
|
||||
|
||||
This function is provided to deal with edge cases concerning URIs
|
||||
@@ -2993,7 +2993,7 @@ class Requirement(object):
|
||||
:param sources: list[dict], optional
|
||||
:param PackageFinder finder: A **PackageFinder** instance from pip's repository implementation
|
||||
:return: A list of Installation Candidates
|
||||
:rtype: list[ :class:`~pip._internal.index.InstallationCandidate` ]
|
||||
:rtype: list[ :class:`~pipenv.patched.pip._internal.index.InstallationCandidate` ]
|
||||
"""
|
||||
|
||||
from .dependencies import find_all_matches, get_finder
|
||||
|
||||
+2
-2
@@ -13,9 +13,9 @@ from pathlib import Path
|
||||
from urllib.parse import parse_qs, urlparse, urlunparse
|
||||
from weakref import finalize
|
||||
|
||||
import attr
|
||||
from pipenv.patched.pip._vendor.pep517 import envbuild, wrappers
|
||||
import pipenv.vendor.attr as attr
|
||||
from pipenv.vendor.distlib.wheel import Wheel
|
||||
from pep517 import envbuild, wrappers
|
||||
from pipenv.patched.pip._internal.network.download import Downloader
|
||||
from pipenv.patched.pip._internal.utils.temp_dir import global_tempdir_manager
|
||||
from pipenv.patched.pip._internal.utils.urls import url_to_path
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
# -*- coding=utf-8 -*-
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
from urllib.parse import quote
|
||||
from urllib.parse import unquote as url_unquote
|
||||
from urllib.parse import unquote_plus
|
||||
|
||||
+5
-5
@@ -840,7 +840,7 @@ def name_from_req(req):
|
||||
def make_install_requirement(
|
||||
name, version=None, extras=None, markers=None, constraint=False
|
||||
):
|
||||
"""Generates an :class:`~pip._internal.req.req_install.InstallRequirement`.
|
||||
"""Generates an :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`.
|
||||
|
||||
Create an InstallRequirement from the supplied metadata.
|
||||
|
||||
@@ -855,7 +855,7 @@ def make_install_requirement(
|
||||
:param constraint: Whether to flag the requirement as a constraint, defaults to False.
|
||||
:param constraint: bool, optional
|
||||
:return: A generated InstallRequirement
|
||||
:rtype: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:rtype: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
"""
|
||||
requirement_string = "{0}".format(name)
|
||||
if extras:
|
||||
@@ -871,10 +871,10 @@ def make_install_requirement(
|
||||
|
||||
def version_from_ireq(ireq):
|
||||
"""version_from_ireq Extract the version from a supplied
|
||||
:class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
|
||||
:param ireq: An InstallRequirement
|
||||
:type ireq: :class:`~pip._internal.req.req_install.InstallRequirement`
|
||||
:type ireq: :class:`~pipenv.patched.pip._internal.req.req_install.InstallRequirement`
|
||||
:return: The version of the InstallRequirement.
|
||||
:rtype: str
|
||||
"""
|
||||
@@ -896,7 +896,7 @@ def clean_requires_python(candidates):
|
||||
`requires_python` attributes."""
|
||||
all_candidates = []
|
||||
sys_version = ".".join(map(str, sys.version_info[:3]))
|
||||
from pip._vendor.packaging.version import parse as parse_version
|
||||
from pipenv.patched.pip._vendor.packaging.version import parse as parse_version
|
||||
|
||||
py_version = parse_version(os.environ.get("PIP_PYTHON_VERSION", sys_version))
|
||||
for c in candidates:
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ from pipenv.vendor.vistir.path import ensure_mkdir_p, is_valid_url
|
||||
from .environment import MYPY_RUNNING
|
||||
|
||||
if MYPY_RUNNING:
|
||||
from typing import Any, Dict, Iterable, List, Optional, Text, Tuple, TypeVar, Union
|
||||
from typing import Dict, List, Optional, Text, Tuple, TypeVar, Union
|
||||
|
||||
STRING_TYPE = Union[bytes, str, Text]
|
||||
S = TypeVar("S", bytes, str, Text)
|
||||
|
||||
Vendored
+1
-1
@@ -18,7 +18,7 @@ ptyprocess==0.7.0
|
||||
pyparsing==3.0.9
|
||||
python-dotenv==0.19.0
|
||||
pythonfinder==1.3.1
|
||||
requirementslib==2.0.1
|
||||
requirementslib==2.0.2
|
||||
shellingham==1.5.0
|
||||
six==1.16.0
|
||||
termcolor==1.1.0
|
||||
|
||||
Reference in New Issue
Block a user