Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 932c190

Browse filesBrowse files
committed
Rename VersionInfo to Version
1 parent 172d986 commit 932c190
Copy full SHA for 932c190

16 files changed

+268
-247
lines changed

‎changelog.d/305.feature.rst

Copy file name to clipboard
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename :class:`VersionInfo` to :class:`Version` but keep an alias for compatibility

‎docs/coerce.py

Copy file name to clipboardExpand all lines: docs/coerce.py
+4-4
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717

1818
def coerce(version):
1919
"""
20-
Convert an incomplete version string into a semver-compatible VersionInfo
20+
Convert an incomplete version string into a semver-compatible Version
2121
object
2222
2323
* Tries to detect a "basic" version string (``major.minor.patch``).
2424
* If not enough components can be found, missing components are
2525
set to zero to obtain a valid semver version.
2626
2727
:param str version: the version string to convert
28-
:return: a tuple with a :class:`VersionInfo` instance (or ``None``
28+
:return: a tuple with a :class:`Version` instance (or ``None``
2929
if it's not a version) and the rest of the string which doesn't
3030
belong to a basic version.
31-
:rtype: tuple(:class:`VersionInfo` | None, str)
31+
:rtype: tuple(:class:`Version` | None, str)
3232
"""
3333
match = BASEVERSION.search(version)
3434
if not match:
@@ -37,6 +37,6 @@ def coerce(version):
3737
ver = {
3838
key: 0 if value is None else value for key, value in match.groupdict().items()
3939
}
40-
ver = semver.VersionInfo(**ver)
40+
ver = semver.Version(**ver)
4141
rest = match.string[match.end() :] # noqa:E203
4242
return ver, rest

‎docs/semverwithvprefix.py

Copy file name to clipboardExpand all lines: docs/semverwithvprefix.py
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
from semver import VersionInfo
1+
from semver import Version
22

33

4-
class SemVerWithVPrefix(VersionInfo):
4+
class SemVerWithVPrefix(Version):
55
"""
6-
A subclass of VersionInfo which allows a "v" prefix
6+
A subclass of Version which allows a "v" prefix
77
"""
88

99
@classmethod
1010
def parse(cls, version):
1111
"""
12-
Parse version string to a VersionInfo instance.
12+
Parse version string to a Version instance.
1313
1414
:param version: version string with "v" or "V" prefix
1515
:type version: str

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.