Skip to content
Snippets Groups Projects
Commit a37e0499 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'enh/version_build_number' into 'master'

Enh/version build number

See merge request fsl/fslpy!65
parents 9459c84f db1f70ff
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,20 @@ This document contains the ``fslpy`` release history in reverse chronological ...@@ -2,6 +2,20 @@ This document contains the ``fslpy`` release history in reverse chronological
order. order.
1.10.3 (Sunday September 9th 2018)
----------------------------------
Added
^^^^^
* The :func:`.parseVersionString` function accepts (and ignores) `local
version identifer
<https://www.python.org/dev/peps/pep-0440/#local-version-identifiers>`_
strings.
1.10.2 (Friday September 7th 2018) 1.10.2 (Friday September 7th 2018)
---------------------------------- ----------------------------------
......
...@@ -31,8 +31,14 @@ is compatible with PEP 440 (https://www.python.org/dev/peps/pep-0440/): ...@@ -31,8 +31,14 @@ is compatible with PEP 440 (https://www.python.org/dev/peps/pep-0440/):
which primarily involve bug-fixes and minor changes. which primarily involve bug-fixes and minor changes.
The sole exception to the above convention are development versions, which end The sole exceptions to the above convention are:
in ``'.dev'``.
- development versions, where the point release number is followed by a
development release identifier of the form ``'.devN'``, where ``N``
denotes a specific development release.
- Builds, where the version number ends in ``'+buildN'``, where ``N``
denotes a specific build.
""" """
...@@ -53,7 +59,9 @@ def parseVersionString(versionString): ...@@ -53,7 +59,9 @@ def parseVersionString(versionString):
An error is raised if the ``versionString`` is invalid. An error is raised if the ``versionString`` is invalid.
""" """
components = versionString.split('.') # Ignore build if present
versionString = versionString.split('+')[0]
components = versionString.split('.')
# Truncate after three elements - # Truncate after three elements -
# a development (unreleased version # a development (unreleased version
...@@ -80,6 +88,8 @@ def parseVersionString(versionString): ...@@ -80,6 +88,8 @@ def parseVersionString(versionString):
def compareVersions(v1, v2, ignorePoint=False): def compareVersions(v1, v2, ignorePoint=False):
"""Compares the given ``fslpy`` version numbers. """Compares the given ``fslpy`` version numbers.
Both developemnt versions and build numbers are ignored in the comparison.
:arg v1: Version number to compare :arg v1: Version number to compare
:arg v2: Version number to compare :arg v2: Version number to compare
:arg ignorePoint: Defaults to ``False``. If ``True``, the point release :arg ignorePoint: Defaults to ``False``. If ``True``, the point release
......
...@@ -18,12 +18,17 @@ import fsl.version as fslversion ...@@ -18,12 +18,17 @@ import fsl.version as fslversion
def test_parseVersionString(): def test_parseVersionString():
tests = [ tests = [
('0.0.0', [0, 0, 0]), ('0.0.0', [0, 0, 0]),
('0.0.10', [0, 0, 10]), ('0.0.10', [0, 0, 10]),
('10.0.10', [10, 0, 10]), ('10.0.10', [10, 0, 10]),
('10.10.10', [10, 10, 10]), ('10.10.10', [10, 10, 10]),
('10.10.10.dev', [10, 10, 10]), ('10.10.10.dev', [10, 10, 10]),
('10.10.10.dev0', [10, 10, 10]), ('10.10.10.dev0', [10, 10, 10]),
('10.10.10.dev0', [10, 10, 10]),
('10.10.10+build1', [10, 10, 10]),
('10.10.10+buildB', [10, 10, 10]),
('10.10.10.dev0+build4', [10, 10, 10]),
# old-style hotfix release numbers # old-style hotfix release numbers
('10.10.10a', [10, 10, 10]), ('10.10.10a', [10, 10, 10]),
...@@ -45,6 +50,7 @@ def test_parseVersionString_bad(): ...@@ -45,6 +50,7 @@ def test_parseVersionString_bad():
'a.5.5', 'a.5.5',
'5.5.a', '5.5.a',
'5.5.a', '5.5.a',
'5.5+build0',
] ]
for test in tests: for test in tests:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment