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

Remove QuasiPipTempDirectory and use pip's TempDirectory. #5487

Merged
merged 1 commit into from
Nov 23, 2022
Merged
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
18 changes: 3 additions & 15 deletions pipenv/utils/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@
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 @@ -660,16 +650,14 @@ def constraints(self):

@contextlib.contextmanager
def get_resolver(self, clear=False):
from tempfile import TemporaryDirectory
from pipenv.patched.pip._internal.utils.temp_dir import TempDirectory

with global_tempdir_manager(), get_build_tracker() as build_tracker, TemporaryDirectory(
suffix="-build", prefix="pipenv-"
) as directory:
with global_tempdir_manager(), get_build_tracker() as build_tracker, TempDirectory() as directory:
pip_options = self.pip_options
finder = self.finder
wheel_cache = WheelCache(pip_options.cache_dir, pip_options.format_control)
preparer = self.pip_command.make_requirement_preparer(
temp_build_dir=QuasiPipTempDirectory(path=directory),
temp_build_dir=directory,
options=pip_options,
build_tracker=build_tracker,
session=self.session,
Expand Down