fsl.version

The primary purpose of this module is as a container for the fslpy version number. A handful of convenience functions for managing version numbers are also defined here.

__version__

Current version number, as a string.

parseVersionString

Parses the given version string, and returns a tuple containing the individual components of the version number (see the description of the __version__ attribute).

compareVersions

Compares the given fslpy version numbers.

patchVersion

Patches the given filename, in place, with the given newversion. Searches for a line of the form::.

The fslpy version number consists of three numbers, separated by a period, roughly obeys the Semantic Versioning conventions (http://semver.org/), and is compatible with PEP 440 (https://www.python.org/dev/peps/pep-0440/):

  1. The major release number. This gets updated for major/external releases.

  2. The minor release number. This gets updated for minor/internal releases, which involve new features, bug-fixes, and other updates.

  3. The point release number. This gets updated for minor/internal releases, which primarily involve bug-fixes and minor changes.

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.

fsl.version.__version__ = '3.22.0'

Current version number, as a string.

fsl.version.parseVersionString(versionString)[source]

Parses the given version string, and returns a tuple containing the individual components of the version number (see the description of the __version__ attribute).

An error is raised if the versionString is invalid.

fsl.version.compareVersions(v1, v2, ignorePoint=False)[source]

Compares the given fslpy version numbers.

Both developemnt versions and build numbers are ignored in the comparison.

Parameters:
  • v1 – Version number to compare

  • v2 – Version number to compare

  • ignorePoint – Defaults to False. If True, the point release numbers are ignored in the comparison.

Returns:

One of the following:

  • -1 if v1 < v2 (i.e. v1 is older than v2)

  • 0 if v1 == v2

  • 1 if v1 > v2

fsl.version.patchVersion(filename, newversion)[source]

Patches the given filename, in place, with the given newversion. Searches for a line of the form:

__version__ = '<oldversion>'

and replaces <oldversion> with newversion.