summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst28
1 files changed, 14 insertions, 14 deletions
diff --git a/README.rst b/README.rst
index 257b2a4..2adef1b 100644
--- a/README.rst
+++ b/README.rst
@@ -64,7 +64,7 @@ This module provides classes to handle semantic versions:
- :class:`Version` represents a version number (``0.1.1-alpha+build.2012-05-15``)
- :class:`BaseSpec`-derived classes represent requirement specifications (``>=0.1.1,<0.3.0``):
- - :class:`NativeSpec` describes a natural description syntax
+ - :class:`SimpleSpec` describes a natural description syntax
- :class:`NpmSpec` is used for NPM-style range descriptions.
Versions
@@ -171,12 +171,12 @@ In that case, ``major``, ``minor`` and ``patch`` are mandatory, and must be inte
Requirement specification
-------------------------
-The :class:`NativeSpec` object describes a range of accepted versions:
+The :class:`SimpleSpec` object describes a range of accepted versions:
.. code-block:: pycon
- >>> s = NativeSpec('>=0.1.1') # At least 0.1.1
+ >>> s = SimpleSpec('>=0.1.1') # At least 0.1.1
>>> s.match(Version('0.1.1'))
True
>>> s.match(Version('0.1.1-alpha1')) # pre-release satisfy version spec
@@ -188,7 +188,7 @@ Simpler test syntax is also available using the ``in`` keyword:
.. code-block:: pycon
- >>> s = NativeSpec('==0.1.1')
+ >>> s = SimpleSpec('==0.1.1')
>>> Version('0.1.1-alpha1') in s
True
>>> Version('0.1.2') in s
@@ -199,17 +199,17 @@ Combining specifications can be expressed as follows:
.. code-block:: pycon
- >>> NativeSpec('>=0.1.1,<0.3.0')
+ >>> SimpleSpec('>=0.1.1,<0.3.0')
Using a specification
"""""""""""""""""""""
-The :func:`NativeSpec.filter` method filters an iterable of :class:`Version`:
+The :func:`SimpleSpec.filter` method filters an iterable of :class:`Version`:
.. code-block:: pycon
- >>> s = NativeSpec('>=0.1.0,<0.4.0')
+ >>> s = SimpleSpec('>=0.1.0,<0.4.0')
>>> versions = (Version('0.%d.0' % i) for i in range(6))
>>> for v in s.filter(versions):
... print v
@@ -222,7 +222,7 @@ It is also possible to select the 'best' version from such iterables:
.. code-block:: pycon
- >>> s = NativeSpec('>=0.1.0,<0.4.0')
+ >>> s = SimpleSpec('>=0.1.0,<0.4.0')
>>> versions = (Version('0.%d.0' % i) for i in range(6))
>>> s.select(versions)
Version('0.3.0')
@@ -248,9 +248,9 @@ version-like string into a valid semver version:
Including pre-release identifiers in specifications
"""""""""""""""""""""""""""""""""""""""""""""""""""
-When testing a :class:`Version` against a :class:`NativeSpec`, comparisons are
+When testing a :class:`Version` against a :class:`SimpleSpec`, comparisons are
adjusted for common user expectations; thus, a pre-release version (``1.0.0-alpha``)
-will not satisfy the ``==1.0.0`` :class:`NativeSpec`.
+will not satisfy the ``==1.0.0`` :class:`SimpleSpec`.
Pre-release identifiers will only be compared if included in the :class:`BaseSpec`
definition or (for the empty pre-release number) if a single dash is appended
@@ -259,9 +259,9 @@ definition or (for the empty pre-release number) if a single dash is appended
.. code-block:: pycon
- >>> Version('0.1.0-alpha') in NativeSpec('<0.1.0') # No pre-release identifier
+ >>> Version('0.1.0-alpha') in SimpleSpec('<0.1.0') # No pre-release identifier
False
- >>> Version('0.1.0-alpha') in NativeSpec('<0.1.0-') # Include pre-release in checks
+ >>> Version('0.1.0-alpha') in SimpleSpec('<0.1.0-') # Include pre-release in checks
True
@@ -274,9 +274,9 @@ build metadata is equality.
.. code-block:: pycon
- >>> Version('1.0.0+build2') in NativeSpec('<=1.0.0') # Build metadata ignored
+ >>> Version('1.0.0+build2') in SimpleSpec('<=1.0.0') # Build metadata ignored
True
- >>> Version('1.0.0+build1') in NativeSpec('==1.0.0+build2') # Include build in checks
+ >>> Version('1.0.0+build1') in SimpleSpec('==1.0.0+build2') # Include build in checks
False