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 f673bf6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Features
* :gh:`142` (:pr:`143`): Improved usage section
* :gh:`145` (:pr:`146`): Added posargs in :file:`tox.ini`
* :pr:`157`: Introduce :file:`conftest.py` to improve doctests
* :gh:`167` (:pr:`168`): Introduced global constant :data:`SEMVER_SPEC_VERSION`

Bug Fixes
---------
Expand Down
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 f673bf6

Please sign in to comment.