Skip to content

Commit d97f75a

Browse files
committed
correct remaining project level imports.
1 parent e45d535 commit d97f75a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pipenv/project.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
from __future__ import annotations
32

43
import base64
@@ -23,6 +22,7 @@
2322
from pipenv.environment import Environment
2423
from pipenv.environments import Setting, is_in_virtualenv, normalize_pipfile_path
2524
from pipenv.patched.pip._internal.commands.install import InstallCommand
25+
from pipenv.patched.pip._vendor import pkg_resources
2626
from pipenv.utils.constants import is_type_checking
2727
from pipenv.utils.dependencies import (
2828
get_canonical_names,
@@ -37,6 +37,7 @@
3737
find_windows_executable,
3838
get_workon_home,
3939
is_virtual_environment,
40+
load_path,
4041
looks_like_dir,
4142
safe_expandvars,
4243
system_which,
@@ -55,8 +56,6 @@
5556
if is_type_checking():
5657
from typing import Dict, List, Optional, Set, Text, Tuple, Union
5758

58-
import pkg_resources
59-
6059
TSource = Dict[Text, Union[Text, bool]]
6160
TPackageEntry = Dict[str, Union[bool, str, List[str]]]
6261
TPackage = Dict[str, TPackageEntry]
@@ -243,11 +242,7 @@ def get_location_for_virtualenv(self) -> str:
243242

244243
@property
245244
def working_set(self) -> pkg_resources.WorkingSet:
246-
from pipenv.utils.shell import load_path
247-
248245
sys_path = load_path(self.which("python"))
249-
import pkg_resources
250-
251246
return pkg_resources.WorkingSet(sys_path)
252247

253248
@property

pipenv/utils/resolver.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from pipenv.patched.pip._internal.req.req_file import parse_requirements
2424
from pipenv.patched.pip._internal.utils.hashes import FAVORITE_HASH
2525
from pipenv.patched.pip._internal.utils.temp_dir import global_tempdir_manager
26+
from pipenv.patched.pip._vendor import pkg_resources
2627
from pipenv.project import Project
2728
from pipenv.vendor import click
2829
from pipenv.vendor.requirementslib import Requirement
@@ -1147,8 +1148,6 @@ def resolve_deps(
11471148

11481149
@lru_cache()
11491150
def get_pipenv_sitedir() -> Optional[str]:
1150-
import pkg_resources
1151-
11521151
site_dir = next(
11531152
iter(d for d in pkg_resources.working_set if d.key.lower() == "pipenv"), None
11541153
)

0 commit comments

Comments
 (0)