Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #167: Introduce SEMVER_SPEC_VERSION #168

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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