Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
ef6b1258
Commit
ef6b1258
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Version parser supports local identifer (e.g. a.b.c+build1)
parent
9459c84f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/version.py
+13
-3
13 additions, 3 deletions
fsl/version.py
with
13 additions
and
3 deletions
fsl/version.py
+
13
−
3
View file @
ef6b1258
...
...
@@ -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.
The sole exception to the above convention are development versions, which end
in ``
'
.dev
'
``.
The sole exceptions to the above convention are:
- 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):
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 -
# a development (unreleased version
...
...
@@ -80,6 +88,8 @@ def parseVersionString(versionString):
def
compareVersions
(
v1
,
v2
,
ignorePoint
=
False
):
"""
Compares the given ``fslpy`` version numbers.
Both developemnt versions and build numbers are ignored in the comparison.
:arg v1: Version number to compare
:arg v2: Version number to compare
:arg ignorePoint: Defaults to ``False``. If ``True``, the point release
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment