Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44708ef

Browse files
authored
Merge pull request #314 from tomschr/bugfix/312-usage-doc
Improve usage section
2 parents 073e314 + a8dd4ea commit 44708ef

File tree

5 files changed

+178
-143
lines changed

5 files changed

+178
-143
lines changed

CHANGELOG.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,59 @@ in our repository.
1616

1717
.. towncrier release notes start
1818
19+
Version 3.0.0-dev.2
20+
===================
21+
22+
:Released: 2020-11-04
23+
:Maintainer:
24+
25+
26+
Improved Documentation
27+
----------------------
28+
29+
* :gh:`312`: Rework "Usage" section.
30+
31+
* Mention the rename of :class:`~semver.version.VersionInfo` to
32+
:class:`~semver.version.Version` class
33+
* Remove semver. prefix in doctests to make examples shorter
34+
* Correct some references to dunder methods like
35+
:func:`~.semver.version.Version.__getitem__`,
36+
:func:`~.semver.version.Version.__gt__` etc.
37+
* Remove inconsistencies and mention module level function as
38+
deprecated and discouraged from using
39+
* Make empty :py:func:`super` call in :file:`semverwithvprefix.py` example
40+
41+
42+
43+
----
44+
45+
46+
Version 3.0.0-dev.2
47+
===================
48+
49+
:Released: 2020-11-04
50+
:Maintainer:
51+
52+
53+
Improved Documentation
54+
----------------------
55+
56+
* :gh:`312`: Rework "Usage" section.
57+
58+
* Mention the rename of :class:`~semver.version.VersionInfo` to
59+
:class:`~semver.version.Version` class
60+
* Remove semver. prefix in doctests to make examples shorter
61+
* Correct some references to dunder methods like :func:`__getitem__`,
62+
:func:`__gt__` etc.
63+
* Remove inconsistencies and mention module level function as
64+
deprecated and discouraged from using
65+
* Make empty :py:func:`super` call in :file:`semverwithvprefix.py` example
66+
67+
68+
69+
----
70+
71+
1972
Version 3.0.0-dev.2
2073
===================
2174

changelog.d/213.improvement.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog.d/312.doc.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Rework "Usage" section.
2+
3+
* Mention the rename of :class:`~semver.version.VersionInfo` to
4+
:class:`~semver.version.Version` class
5+
* Remove semver. prefix in doctests to make examples shorter
6+
* Correct some references to dunder methods like
7+
:func:`~.semver.version.Version.__getitem__`,
8+
:func:`~.semver.version.Version.__gt__` etc.
9+
* Remove inconsistencies and mention module level function as
10+
deprecated and discouraged from using
11+
* Make empty :py:func:`super` call in :file:`semverwithvprefix.py` example

docs/semverwithvprefix.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,22 @@ class SemVerWithVPrefix(Version):
77
"""
88

99
@classmethod
10-
def parse(cls, version):
10+
def parse(cls, version: str) -> "SemVerWithVPrefix":
1111
"""
1212
Parse version string to a Version instance.
1313
1414
:param version: version string with "v" or "V" prefix
15-
:type version: str
1615
:raises ValueError: when version does not start with "v" or "V"
1716
:return: a new instance
18-
:rtype: :class:`SemVerWithVPrefix`
1917
"""
2018
if not version[0] in ("v", "V"):
2119
raise ValueError(
2220
"{v!r}: not a valid semantic version tag. Must start with 'v' or 'V'".format(
2321
v=version
2422
)
2523
)
26-
self = super(SemVerWithVPrefix, cls).parse(version[1:])
27-
return self
24+
return super().parse(version[1:])
2825

29-
def __str__(self):
26+
def __str__(self) -> str:
3027
# Reconstruct the tag
31-
return "v" + super(SemVerWithVPrefix, self).__str__()
28+
return "v" + super().__str__()

0 commit comments

Comments
 (0)