-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Requires-Dist and Requires-Python to locks. (#1585)
These bits of metadata are needed to consume the lock without needing to resolve through Pip. Work towards #1583.
- Loading branch information
Showing
11 changed files
with
378 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import absolute_import | ||
|
||
from pex.third_party.packaging import utils as packaging_utils | ||
from pex.typing import TYPE_CHECKING, cast | ||
|
||
if TYPE_CHECKING: | ||
import attr # vendor:skip | ||
else: | ||
from pex.third_party import attr | ||
|
||
|
||
def _canonicalize_version(version): | ||
# type: (str) -> str | ||
return cast(str, packaging_utils.canonicalize_version(version)) | ||
|
||
|
||
@attr.s(frozen=True) | ||
class Version(object): | ||
"""A PEP-440 normalized version: https://www.python.org/dev/peps/pep-0440/#normalization""" | ||
|
||
version = attr.ib(converter=_canonicalize_version) # type: str | ||
|
||
def __str__(self): | ||
# type: () -> str | ||
return self.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.