Skip to content

Navigation Menu

Sign in
Appearance settings

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 1f08632

Browse filesBrowse files
authored
Merge pull request #425 from tomschr/docs-1
Improve documentation wording & consistency
2 parents 0b3d9fa + 1aad4ad commit 1f08632
Copy full SHA for 1f08632

File tree

3 files changed

+24
-19
lines changed
Filter options

3 files changed

+24
-19
lines changed

‎README.rst

Copy file name to clipboardExpand all lines: README.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Quickstart
33

44
.. teaser-begin
55
6-
A Python module for `semantic versioning`_. Simplifies comparing versions.
6+
A Python module to simplify `semantic versioning`_.
77

88
|GHAction| |python-support| |downloads| |license| |docs| |black|
99
|openissues| |GHDiscussion|

‎docs/contribute/doc-semver.rst

Copy file name to clipboardExpand all lines: docs/contribute/doc-semver.rst
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@ used efficiently.
1919
A new feature is *not* complete if it isn't proberly documented. A good
2020
documentation includes:
2121

22+
* **Type annotations**
23+
24+
This library supports type annotations. Therefore, each function
25+
or method requires types for each arguments and return objects.
26+
Exception of this rule is ``self``.
27+
2228
* **A docstring**
2329

2430
Each docstring contains a summary line, a linebreak, an optional
2531
directive (see next item), the description of its arguments in
2632
`Sphinx style`_, and an optional doctest.
2733
The docstring is extracted and reused in the :ref:`api` section.
28-
An appropriate docstring should look like this::
34+
An appropriate docstring looks like this::
2935

3036
def to_tuple(self) -> VersionTuple:
3137
"""
@@ -70,11 +76,11 @@ documentation includes:
7076

7177
* **The documentation**
7278

73-
A docstring is good, but in most cases it's too dense. API documentation
74-
cannot replace a good user documentation. Describe how
75-
to use your new feature in our documentation. Here you can give your
76-
readers more examples, describe it in a broader context or show
77-
edge cases.
79+
A docstring is good, but in most cases it is too short. API documentation
80+
cannot replace good user documentation.
81+
Describe *how* to use your new feature in the documentation.
82+
Here you can give your readers more examples, describe it in a broader
83+
context, or show edge cases.
7884

7985

8086
.. _Sphinx style: https://sphinx-rtd-tutorial.rtfd.io/en/latest/docstrings.html

‎docs/migration/replace-deprecated-functions.rst

Copy file name to clipboardExpand all lines: docs/migration/replace-deprecated-functions.rst
+11-12Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ Replacing Deprecated Functions
88
the module level. The preferred way of using semver is through the
99
:class:`~semver.version.Version` class.
1010

11-
The deprecated functions can still be used in version 2.10.0 and above. In version 3 of
12-
semver, the deprecated functions will be removed.
11+
The deprecated functions can still be used in version 2.10.0 and above. However, in
12+
future versions of semver, the deprecated functions will be removed.
1313

1414
The following list shows the deprecated functions and how you can replace
1515
them with code which is compatible for future versions:
1616

17-
1817
* :func:`semver.bump_major`, :func:`semver.bump_minor`, :func:`semver.bump_patch`, :func:`semver.bump_prerelease`, :func:`semver.bump_build`
1918

2019
Replace them with the respective methods of the :class:`~semver.version.Version`
2120
class.
2221
For example, the function :func:`semver.bump_major` is replaced by
23-
:meth:`~semver.version.Version.bump_major` and calling the ``str(versionobject)``:
22+
:meth:`Version.bump_major <semver.version.Version.bump_major>` and calling the ``str(versionobject)``:
2423

2524
.. code-block:: python
2625
@@ -31,14 +30,14 @@ them with code which is compatible for future versions:
3130
3231
Likewise with the other module level functions.
3332

34-
* :func:`semver.Version.isvalid`
33+
* :meth:`semver.Version.isvalid`
3534

36-
Replace it with :meth:`semver.version.Version.is_valid`:
35+
Replace it with :meth:`Version.is_valid <semver.version.Version.is_valid>`:
3736

3837

3938
* :func:`semver.finalize_version`
4039

41-
Replace it with :func:`semver.version.Version.finalize_version`:
40+
Replace it with :meth:`Version.finalize_version <semver.version.Version.finalize_version>`:
4241

4342
.. code-block:: python
4443
@@ -71,7 +70,7 @@ them with code which is compatible for future versions:
7170
7271
* :func:`semver.min_ver`
7372

74-
Replace it with ``min(version1, version2, ...)`` or ``min([version1, version2, ...])``:
73+
Replace it with ``min(version1, version2, ...)`` or ``min([version1, version2, ...])`` and a ``key``:
7574

7675
.. code-block:: python
7776
@@ -82,8 +81,8 @@ them with code which is compatible for future versions:
8281
8382
* :func:`semver.parse`
8483

85-
Replace it with :meth:`semver.version.Version.parse` and call
86-
:meth:`semver.version.Version.to_dict`:
84+
Replace it with :meth:`Version.parse <semver.version.Version.parse>` and call
85+
:meth:`Version.to_dict <semver.version.Version.to_dict>`:
8786

8887
.. code-block:: python
8988
@@ -94,7 +93,7 @@ them with code which is compatible for future versions:
9493
9594
* :func:`semver.parse_version_info`
9695

97-
Replace it with :meth:`semver.version.Version.parse`:
96+
Replace it with :meth:`Version.parse <semver.version.Version.parse>`:
9897

9998
.. code-block:: python
10099
@@ -105,7 +104,7 @@ them with code which is compatible for future versions:
105104
106105
* :func:`semver.replace`
107106

108-
Replace it with :meth:`semver.version.Version.replace`:
107+
Replace it with :meth:`Version.replace <semver.version.Version.replace>`:
109108

110109
.. code-block:: python
111110

0 commit comments

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