From cfcbec733ca4c5aa1f44a4cb44f4002b50f9b576 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 13 May 2020 20:54:25 +0200 Subject: [PATCH] Make docstrings consistent * Use VersionInfo instead of semver.VersionInfo * Change order. Deprecation notice should come first in docstring --- semver.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/semver.py b/semver.py index b9de42b4..00338e8f 100644 --- a/semver.py +++ b/semver.py @@ -644,9 +644,9 @@ def parse(version): Parse version string to a VersionInfo instance. :param version: version string - :return: a :class:`semver.VersionInfo` instance + :return: a :class:`VersionInfo` instance :raises: :class:`ValueError` - :rtype: :class:`semver.VersionInfo` + :rtype: :class:`VersionInfo` >>> semver.VersionInfo.parse('3.4.5-pre.2+build.4') VersionInfo(major=3, minor=4, patch=5, \ @@ -667,14 +667,14 @@ def parse(version): def replace(self, **parts): """ Replace one or more parts of a version and return a new - :class:`semver.VersionInfo` object, but leave self untouched + :class:`VersionInfo` object, but leave self untouched .. versionadded:: 2.9.0 Added :func:`VersionInfo.replace` :param dict parts: the parts to be updated. Valid keys are: ``major``, ``minor``, ``patch``, ``prerelease``, or ``build`` - :return: the new :class:`semver.VersionInfo` object with the changed + :return: the new :class:`VersionInfo` object with the changed parts :raises: :class:`TypeError`, if ``parts`` contains invalid keys """ @@ -975,12 +975,12 @@ def finalize_version(version): """ Remove any prerelease and build metadata from the version string. - .. versionadded:: 2.7.9 - Added :func:`finalize_version` - .. deprecated:: 2.10.0 Use :func:`semver.VersionInfo.finalize_version` instead. + .. versionadded:: 2.7.9 + Added :func:`finalize_version` + :param version: version string :return: the finalized version string :rtype: str @@ -997,12 +997,12 @@ def replace(version, **parts): """ Replace one or more parts of a version and return the new string. - .. versionadded:: 2.9.0 - Added :func:`replace` - .. deprecated:: 2.10.0 Use :func:`semver.VersionInfo.replace` instead. + .. versionadded:: 2.9.0 + Added :func:`replace` + :param str version: the version string to replace :param dict parts: the parts to be updated. Valid keys are: ``major``, ``minor``, ``patch``, ``prerelease``, or ``build``