Skip to content

Commit

Permalink
Fix #167: Introdue SEMVER_SPEC_VERSION
Browse files Browse the repository at this point in the history
Global constant, definies the implemented semantic version
specification
  • Loading branch information
tomschr committed Oct 13, 2019
1 parent 1f7778a commit 07da05c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ Each type can be converted into the other, if the minimum requirements
are met.


Knowing the Implemented semver.org Version
------------------------------------------

The semver.org is the authorative specification of how semantical versioning is
definied. To know which version of semver.org is implemented in the semver
libary, use the following constant::

>>> semver.SEMVER_SPEC_VERSION
'2.0.0'


Creating a Version
------------------

Expand Down
4 changes: 4 additions & 0 deletions semver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

_LAST_NUMBER = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+')

#: Contains the implemented semver.org version of the spec
SEMVER_SPEC_VERSION = "2.0.0"


if not hasattr(__builtins__, 'cmp'):
def cmp(a, b):
return (a > b) - (a < b)
Expand Down

0 comments on commit 07da05c

Please sign in to comment.