Get an all-lowercase version of the requirement's name. **Note:** If the argument is an instance of ``pip._internal.resolution.resolvelib.base.Requirement`` (like ``pip._internal.resolution.resolvelib.requirements.SpecifierRequirement``), then the name might include an extras s
(req: InstallRequirement | Requirement | PipRequirement)
| 67 | |
| 68 | |
| 69 | def key_from_req(req: InstallRequirement | Requirement | PipRequirement) -> str: |
| 70 | """ |
| 71 | Get an all-lowercase version of the requirement's name. |
| 72 | |
| 73 | **Note:** If the argument is an instance of |
| 74 | ``pip._internal.resolution.resolvelib.base.Requirement`` (like |
| 75 | ``pip._internal.resolution.resolvelib.requirements.SpecifierRequirement``), |
| 76 | then the name might include an extras specification. |
| 77 | Apply :py:func:`strip_extras` to the result of this function if you need |
| 78 | the package name only. |
| 79 | |
| 80 | :param req: the requirement the key is computed for |
| 81 | :return: the canonical name of the requirement |
| 82 | """ |
| 83 | return canonicalize_name(req.name) |
| 84 | |
| 85 | |
| 86 | def comment(text: str) -> str: |
searching dependent graphs…