mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #6980 from pradyunsg/refactor/simplify-make_distribution
Improve make_distribution_for_install_requirement()
This commit is contained in:
commit
c3c2831893
|
@ -12,11 +12,13 @@ def make_distribution_for_install_requirement(install_req):
|
|||
# type: (InstallRequirement) -> AbstractDistribution
|
||||
"""Returns a Distribution for the given InstallRequirement
|
||||
"""
|
||||
# If it's not an editable, is a wheel, it's a WheelDistribution
|
||||
# Editable requirements will always be source distributions. They use the
|
||||
# legacy logic until we create a modern standard for them.
|
||||
if install_req.editable:
|
||||
return SourceDistribution(install_req)
|
||||
|
||||
if install_req.link and install_req.is_wheel:
|
||||
# If it's a wheel, it's a WheelDistribution
|
||||
if install_req.is_wheel:
|
||||
return WheelDistribution(install_req)
|
||||
|
||||
# Otherwise, a SourceDistribution
|
||||
|
|
Loading…
Reference in a new issue