File: increase-parts-of-a-version_prereleases.rst

package info (click to toggle)
python-semver 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 700 kB
  • sloc: python: 1,972; makefile: 28
file content (24 lines) | stat: -rw-r--r-- 787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.. _increase-parts-of-a-version:

Increasing Parts of a Version Taking into Account Prereleases
=============================================================

.. versionadded:: 2.10.0
   Added :meth:`~semver.version.Version.next_version`.

If you want to raise your version and take prereleases into account,
the function :meth:`~semver.version.Version.next_version`
would perhaps a better fit.


.. code-block:: python

    >>> v = Version.parse("3.4.5-pre.2+build.4")
    >>> str(v.next_version(part="prerelease"))
    '3.4.5-pre.3'
    >>> str(Version.parse("3.4.5-pre.2+build.4").next_version(part="patch"))
    '3.4.5'
    >>> str(Version.parse("3.4.5+build.4").next_version(part="patch"))
    '3.4.5'
    >>> str(Version.parse("0.1.4").next_version("prerelease"))
    '0.1.5-rc.1'