summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-09-15 23:18:13 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-09-15 23:40:59 +0200
commit2ed3d39c291080c61edd9139370939e1fdc3209a (patch)
tree22a90dfae0e0fc9fd7949ca18e7e47daa8f8aabb /README.rst
parent4aac5768db2fc158fa87900b54210ecba4dfe6d5 (diff)
downloadsemantic-version-2ed3d39c291080c61edd9139370939e1fdc3209a.tar.gz
Forbid build metadata ordering (See #18)
SemVer 2.0.0 states that "Build metadata SHOULD be ignored when determining version precedence". This means that, when comparing ``0.1.0+1`` to ``0.1.0+bcd``:: >>> Version('0.1.0+1') == Version('0.1.0+bcd') False >>> Version('0.1.0+1') != Version('0.1.0+bcd') True >>> Version('0.1.0+1') < Version('0.1.0+bcd') False >>> Version('0.1.0+1') > Version('0.1.0+bcd') False >>> Version('0.1.0+1') <= Version('0.1.0+bcd') False >>> Version('0.1.0+1') >= Version('0.1.0+bcd') False >>> compare(Version('0.1.0+1'), Version('0.1.0+bcd')) NotImplemented This change also has the following effects: - When including build metadata in a ``Spec``, the only valid options are ``Spec('==0.1.0+sth')`` and ``Spec('!=0.1.0+sth')`` - The meaning of ``Spec('==0.1.0+')`` is now "Only version 0.1.0 without build metadata" - ``Spec('==0.1.0')`` now matches ``Version('0.1.0+anything')``
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst13
1 files changed, 6 insertions, 7 deletions
diff --git a/README.rst b/README.rst
index 5923a30..484692e 100644
--- a/README.rst
+++ b/README.rst
@@ -247,19 +247,18 @@ definition or (for the empty pre-release number) if a single dash is appended
False
-Including build identifiers in specifications
-"""""""""""""""""""""""""""""""""""""""""""""
+Including build metadata in specifications
+""""""""""""""""""""""""""""""""""""""""""
-The same rule applies for the build identifier: comparisons will include it only
-if it was included in the :class:`Spec` definition, or - for the unnumbered build
-version - if a single + is appended to the definition(``1.0.0+``, ``1.0.0-alpha+``):
+Build metadata has no ordering; thus, the only meaningful comparison including
+build metadata is equality.
.. code-block:: pycon
- >>> Version('1.0.0+build2') in Spec('<=1.0.0') # Build identifier ignored
+ >>> Version('1.0.0+build2') in Spec('<=1.0.0') # Build metadata ignored
True
- >>> Version('1.0.0+build2') in Spec('<=1.0.0+') # Include build in checks
+ >>> Version('1.0.0+build2') in Spec('==1.0.0+build2') # Include build in checks
False