niftynet.utilities.versioneer_version module¶
Git implementation of _version.py.
-
exception
NotThisMethod
[source]¶ Bases:
exceptions.Exception
Exception raised if a method is not valid for the current scenario.
-
register_vcs_handler
(vcs, method)[source]¶ Decorator to mark a method as the handler for a particular VCS.
-
run_command
(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None)[source]¶ Call the given command(s).
-
versions_from_parentdir
(parentdir_prefix, root, verbose)[source]¶ Try to determine the version from the parent directory name.
Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory
-
git_versions_from_keywords
(keywords, tag_prefix, verbose)[source]¶ Get version information from git keywords.
-
git_pieces_from_vcs
(tag_prefix, root, verbose, run_command=<function run_command>)[source]¶ Get version from ‘git describe’ in the root of the source tree.
This only gets called if the git-archive ‘subst’ keywords were not expanded, and _version.py hasn’t already been rewritten with a short version string, meaning we’re inside a checked out source tree.
-
render_pep440
(pieces)[source]¶ Build up version string, with post-release “local version identifier”.
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you’ll get TAG+0.gHEX.dirty
Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
-
render_pep440_pre
(pieces)[source]¶ TAG[.post.devDISTANCE] – No -dirty.
Exceptions: 1: no tags. 0.post.devDISTANCE
-
render_pep440_post
(pieces)[source]¶ TAG[.postDISTANCE[.dev0]+gHEX] .
The “.dev0” means dirty. Note that .dev0 sorts backwards (a dirty tree will appear “older” than the corresponding clean one), but you shouldn’t be releasing software with -dirty anyways.
Exceptions: 1: no tags. 0.postDISTANCE[.dev0]
-
render_pep440_old
(pieces)[source]¶ TAG[.postDISTANCE[.dev0]] .
The “.dev0” means dirty.
Eexceptions: 1: no tags. 0.postDISTANCE[.dev0]
-
render_git_describe
(pieces)[source]¶ TAG[-DISTANCE-gHEX][-dirty].
Like ‘git describe –tags –dirty –always’.
Exceptions: 1: no tags. HEX[-dirty] (note: no ‘g’ prefix)