Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version requirementslib and more vendor clean up #5481

Merged
merged 18 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
with:
api_key: ${{ secrets.FORESIGHT_API_KEY }}
- run: |
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier requests
python -m pip install --upgrade wheel invoke parver bs4 vistir towncrier requests parse
python -m invoke vendoring.update
tests:
name: ${{matrix.os}} / ${{ matrix.python-version }}
Expand Down
6 changes: 6 additions & 0 deletions news/5481.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bump version of requirementslib to 2.2.0
Drop yaspin which is no longer used.
Bump vistir to version 0.7.4
Remove parse.
Remove termcolor.
Remove idna.
7 changes: 4 additions & 3 deletions pipenv/utils/internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from urllib.parse import urlparse

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

requests_session = None # type: ignore

Expand Down Expand Up @@ -121,6 +120,8 @@ def proper_case(package_name):
if not r.ok:
raise OSError(f"Unable to find package {package_name} in PyPI repository.")

r = parse.parse("https://pypi.org/pypi/{name}/json", r.url)
good_name = r["name"]
regex = r"https://pypi\.org/pypi/(.*)/json$"
match = re.search(regex, r.url)
good_name = match.group(1)

return good_name
19 changes: 15 additions & 4 deletions pipenv/utils/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from pipenv.vendor.requirementslib import Requirement
from pipenv.vendor.requirementslib.models.requirements import Line
from pipenv.vendor.requirementslib.models.utils import DIRECT_URL_RE
from pipenv.vendor.vistir import TemporaryDirectory, open_file
from pipenv.vendor.vistir import open_file
from pipenv.vendor.vistir.path import create_tracked_tempdir

try:
Expand Down Expand Up @@ -63,6 +63,16 @@
err = rich.console.Console(stderr=True)


class QuasiPipTempDirectory:
"""A fake pip temp directory that is only used to pass path.

We add this because we can't monkeypatch a string instance.
"""

def __init__(self, path):
self.path = path


def get_package_finder(
install_cmd=None,
options=None,
Expand Down Expand Up @@ -650,15 +660,16 @@ def constraints(self):

@contextlib.contextmanager
def get_resolver(self, clear=False):
from tempfile import TemporaryDirectory

with global_tempdir_manager(), get_build_tracker() as build_tracker, TemporaryDirectory(
suffix="-build", prefix="pipenv-"
) as directory:
pip_options = self.pip_options
finder = self.finder
wheel_cache = WheelCache(pip_options.cache_dir, pip_options.format_control)
directory.path = directory.name
preparer = self.pip_command.make_requirement_preparer(
temp_build_dir=directory,
temp_build_dir=QuasiPipTempDirectory(path=directory),
options=pip_options,
build_tracker=build_tracker,
session=self.session,
Expand Down Expand Up @@ -915,7 +926,7 @@ def actually_resolve_deps(
def resolve(cmd, st, project):
from pipenv._compat import decode_output
from pipenv.cmdparse import Script
from pipenv.vendor.vistir.misc import echo
from pipenv.vendor.click import echo

c = subprocess_run(Script.parse(cmd).cmd_args, block=False, env=os.environ.copy())
is_verbose = project.s.is_verbose()
Expand Down
29 changes: 0 additions & 29 deletions pipenv/vendor/idna/LICENSE.md

This file was deleted.

44 changes: 0 additions & 44 deletions pipenv/vendor/idna/__init__.py

This file was deleted.

117 changes: 0 additions & 117 deletions pipenv/vendor/idna/codec.py

This file was deleted.

16 changes: 0 additions & 16 deletions pipenv/vendor/idna/compat.py

This file was deleted.

Loading