Skip to content

Commit

Permalink
Remove urllib3 from vendor, use pip._vendor
Browse files Browse the repository at this point in the history
See #5174
  • Loading branch information
oz123 committed Jul 31, 2022
1 parent 962933d commit 7a07786
Show file tree
Hide file tree
Showing 48 changed files with 17 additions and 11,348 deletions.
13 changes: 8 additions & 5 deletions pipenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
import warnings

from pipenv.__version__ import __version__ # noqa
from pipenv.patched.pip._vendor.urllib3.exceptions import DependencyWarning

warnings.filterwarnings("ignore", category=DependencyWarning)
warnings.filterwarnings("ignore", category=ResourceWarning)
warnings.filterwarnings("ignore", category=UserWarning)
PIPENV_ROOT = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))

PIPENV_VENDOR = os.sep.join([PIPENV_ROOT, "vendor"])
PIPENV_PATCHED = os.sep.join([PIPENV_ROOT, "patched"])
# PIP_VENDOR = os.sep.join([PIPENV_ROOT, "patched", "pip", "_vendor"])

# sys.path.insert(0, PIP_VENDOR)
# Inject vendored directory into system path.
sys.path.insert(0, PIPENV_VENDOR)
# Inject patched directory into system path.
sys.path.insert(0, PIPENV_PATCHED)

from pipenv.vendor.urllib3.exceptions import DependencyWarning

warnings.filterwarnings("ignore", category=DependencyWarning)
warnings.filterwarnings("ignore", category=ResourceWarning)
warnings.filterwarnings("ignore", category=UserWarning)

# Load patched pip instead of system pip
os.environ["PIP_SHIMS_BASE_MODULE"] = "pipenv.patched.pip"
Expand Down
3 changes: 1 addition & 2 deletions pipenv/utils/indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import re
from collections.abc import Mapping

from urllib3.util import parse_url

from pipenv.exceptions import PipenvUsageError
from pipenv.patched.pip._vendor.urllib3.util import parse_url
from pipenv.utils.constants import MYPY_RUNNING

from .internet import create_mirror_source, is_pypi_url
Expand Down
3 changes: 1 addition & 2 deletions pipenv/utils/internet.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re
from urllib.parse import urlparse

from urllib3 import util as urllib3_util

from pipenv.patched.pip._vendor.urllib3 import util as urllib3_util
from pipenv.vendor import parse

requests_session = None # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/requirementslib/models/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import pipenv.vendor.attr as attr
from pipenv.vendor.orderedmultidict import omdict
from pipenv.vendor.pip_shims import shims
from pipenv.vendor.urllib3.util import parse_url as urllib3_parse
from pipenv.vendor.urllib3.util.url import Url
from pipenv.patched.pip._vendor.urllib3.util import parse_url as urllib3_parse
from pipenv.patched.pip._vendor.urllib3.util.url import Url

from ..environment import MYPY_RUNNING
from ..utils import is_installable_file
Expand Down
6 changes: 3 additions & 3 deletions pipenv/vendor/requirementslib/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from pipenv.vendor.plette.models import Package, PackageCollection
from pipenv.vendor.tomlkit.container import Container
from pipenv.vendor.tomlkit.items import AoT, Array, Bool, InlineTable, Item, String, Table
from pipenv.vendor.urllib3 import util as urllib3_util
from pipenv.vendor.urllib3.util import parse_url as urllib3_parse
from pipenv.patched.pip._vendor.urllib3 import util as urllib3_util
from pipenv.patched.pip._vendor.urllib3.util import parse_url as urllib3_parse
from pipenv.vendor.vistir.misc import dedup
from pipenv.vendor.vistir.path import is_valid_url

Expand Down Expand Up @@ -52,7 +52,7 @@
from pipenv.patched.pip._vendor.packaging.requirements import Requirement as PackagingRequirement
from pipenv.vendor.pip_shims.shims import Link
from pkg_resources import Requirement as PkgResourcesRequirement
from pipenv.vendor.urllib3.util.url import Url
from pipenv.patched.pip._vendor.urllib3.util.url import Url

_T = TypeVar("_T")
TMarker = Union[Marker, PkgResourcesMarker]
Expand Down
21 changes: 0 additions & 21 deletions pipenv/vendor/urllib3/LICENSE.txt

This file was deleted.

85 changes: 0 additions & 85 deletions pipenv/vendor/urllib3/__init__.py

This file was deleted.

Loading

0 comments on commit 7a07786

Please sign in to comment.