Skip to content

Commit a8dd4ea

Browse files
committed
Fix #312: Rework Usage section
* Correct :class: directive and use :class:`~semver.version.Version` * Mention the rename of VersionInfo -> Version class * Remove semver. prefix in doctests to make examples shorter * Correct some references to dunder methods like __getitem__, __gt__ etc. * Use :py:exec: reference to Python exceptions. * Remove inconsistencies and mention module level function as deprecated and discouraged from using * Make empty super() call in semverwithvprefix.py example * Add changelog.d file
1 parent ff204d7 commit a8dd4ea

File tree

4 files changed

+178
-142
lines changed

4 files changed

+178
-142
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/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy