|
10 | 10 | import zipfile
|
11 | 11 | from typing import Any, Collection, Dict, Iterable, List, Optional, Sequence, Union
|
12 | 12 |
|
13 |
| -from pip._vendor import pkg_resources |
14 | 13 | from pip._vendor.packaging.markers import Marker
|
15 | 14 | from pip._vendor.packaging.requirements import Requirement
|
16 | 15 | from pip._vendor.packaging.specifiers import SpecifierSet
|
|
54 | 53 | hide_url,
|
55 | 54 | redact_auth_from_url,
|
56 | 55 | )
|
| 56 | +from pip._internal.utils.packaging import safe_extra |
57 | 57 | from pip._internal.utils.subprocess import runner_with_spinner_message
|
58 | 58 | from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
|
59 | 59 | from pip._internal.utils.virtualenv import running_under_virtualenv
|
@@ -119,15 +119,14 @@ def __init__(
|
119 | 119 | if extras:
|
120 | 120 | self.extras = extras
|
121 | 121 | elif req:
|
122 |
| - self.extras = {pkg_resources.safe_extra(extra) for extra in req.extras} |
| 122 | + self.extras = {safe_extra(extra) for extra in req.extras} |
123 | 123 | else:
|
124 | 124 | self.extras = set()
|
125 | 125 | if markers is None and req:
|
126 | 126 | markers = req.marker
|
127 | 127 | self.markers = markers
|
128 | 128 |
|
129 |
| - # This holds the pkg_resources.Distribution object if this requirement |
130 |
| - # is already available: |
| 129 | + # This holds the Distribution object if this requirement is already installed. |
131 | 130 | self.satisfied_by: Optional[BaseDistribution] = None
|
132 | 131 | # Whether the installation process should try to uninstall an existing
|
133 | 132 | # distribution before installing this requirement.
|
@@ -216,7 +215,7 @@ def format_debug(self) -> str:
|
216 | 215 | def name(self) -> Optional[str]:
|
217 | 216 | if self.req is None:
|
218 | 217 | return None
|
219 |
| - return pkg_resources.safe_name(self.req.name) |
| 218 | + return self.req.name |
220 | 219 |
|
221 | 220 | @functools.lru_cache() # use cached_property in python 3.8+
|
222 | 221 | def supports_pyproject_editable(self) -> bool:
|
|
0 commit comments