File: check-valid-semver-version.rst

package info (click to toggle)
python-semver 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 700 kB
  • sloc: python: 1,972; makefile: 28
file content (12 lines) | stat: -rw-r--r-- 312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
Checking for a Valid Semver Version
===================================

If you need to check a string if it is a valid semver version, use the
classmethod :meth:`~semver.version.Version.is_valid`:

.. code-block:: python

    >>> Version.is_valid("1.0.0")
    True
    >>> Version.is_valid("invalid")
    False