|
2 | 2 | # This file is dual licensed under the terms of the Apache License, Version
|
3 | 3 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
4 | 4 | # for complete details.
|
5 |
| -""" |
| 5 | +"""Backport of the ``packaging.version`` module from Python 3.8. |
| 6 | +
|
6 | 7 | .. testsetup::
|
7 | 8 |
|
8 | 9 | from packaging.version import parse, Version
|
@@ -159,7 +160,7 @@ def __ne__(self, other: object) -> bool:
|
159 | 160 |
|
160 | 161 |
|
161 | 162 | class Version(_BaseVersion):
|
162 |
| - """This class abstracts handling of a project's versions. |
| 163 | + """Class abstracts handling of a project's versions. |
163 | 164 |
|
164 | 165 | A :class:`Version` instance is comparison aware and can be compared and
|
165 | 166 | sorted using the standard Python interfaces.
|
@@ -222,15 +223,15 @@ def __init__(self, version: str) -> None:
|
222 | 223 | )
|
223 | 224 |
|
224 | 225 | def __repr__(self) -> str:
|
225 |
| - """A representation of the Version that shows all internal state. |
| 226 | + """Return representation of the Version that shows all internal state. |
226 | 227 |
|
227 | 228 | >>> Version('1.0.0')
|
228 | 229 | <Version('1.0.0')>
|
229 | 230 | """
|
230 | 231 | return f"<Version('{self}')>"
|
231 | 232 |
|
232 | 233 | def __str__(self) -> str:
|
233 |
| - """A string representation of the version that can be rounded-tripped. |
| 234 | + """Return string representation of the version that can be rounded-tripped. |
234 | 235 |
|
235 | 236 | >>> str(Version("1.0a5"))
|
236 | 237 | '1.0a5'
|
@@ -491,7 +492,7 @@ def _parse_letter_version(
|
491 | 492 |
|
492 | 493 |
|
493 | 494 | def _parse_local_version(local: str) -> Optional[LocalType]:
|
494 |
| - """Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").""" |
| 495 | + """Take a string like abc.1.twelve and turns it into ("abc", 1, "twelve").""" |
495 | 496 | if local is not None:
|
496 | 497 | return tuple(
|
497 | 498 | part.lower() if not part.isdigit() else int(part)
|
|
0 commit comments