Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/pip/_internal/distributions/__init__.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 from pip._internal.distributions.sdist import SourceDistribution | |
2 from pip._internal.distributions.wheel import WheelDistribution | |
3 from pip._internal.utils.typing import MYPY_CHECK_RUNNING | |
4 | |
5 if MYPY_CHECK_RUNNING: | |
6 from pip._internal.distributions.base import AbstractDistribution | |
7 from pip._internal.req.req_install import InstallRequirement | |
8 | |
9 | |
10 def make_distribution_for_install_requirement(install_req): | |
11 # type: (InstallRequirement) -> AbstractDistribution | |
12 """Returns a Distribution for the given InstallRequirement | |
13 """ | |
14 # Editable requirements will always be source distributions. They use the | |
15 # legacy logic until we create a modern standard for them. | |
16 if install_req.editable: | |
17 return SourceDistribution(install_req) | |
18 | |
19 # If it's a wheel, it's a WheelDistribution | |
20 if install_req.is_wheel: | |
21 return WheelDistribution(install_req) | |
22 | |
23 # Otherwise, a SourceDistribution | |
24 return SourceDistribution(install_req) |