Skip to content

Commit def5ba8

Browse files
authored
Simplify direct_url.json generation (#11875)
1 parent d894759 commit def5ba8

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/pip/_internal/req/req_install.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444
from pip._internal.pyproject import load_pyproject_toml, make_pyproject_path
4545
from pip._internal.req.req_uninstall import UninstallPathSet
4646
from pip._internal.utils.deprecation import LegacyInstallReason, deprecated
47-
from pip._internal.utils.direct_url_helpers import (
48-
direct_url_for_editable,
49-
direct_url_from_link,
50-
)
5147
from pip._internal.utils.hashes import Hashes
5248
from pip._internal.utils.misc import (
5349
ConfiguredBuildBackendHookCaller,
@@ -779,24 +775,14 @@ def install(
779775

780776
if self.is_wheel:
781777
assert self.local_file_path
782-
direct_url = None
783-
# TODO this can be refactored to direct_url = self.download_info
784-
if self.editable:
785-
direct_url = direct_url_for_editable(self.unpacked_source_directory)
786-
elif self.original_link:
787-
direct_url = direct_url_from_link(
788-
self.original_link,
789-
self.source_dir,
790-
self.original_link_is_in_wheel_cache,
791-
)
792778
install_wheel(
793779
self.name,
794780
self.local_file_path,
795781
scheme=scheme,
796782
req_description=str(self.req),
797783
pycompile=pycompile,
798784
warn_script_location=warn_script_location,
799-
direct_url=direct_url,
785+
direct_url=self.download_info if self.original_link else None,
800786
requested=self.user_supplied,
801787
)
802788
self.install_succeeded = True

0 commit comments

Comments
 (0)