Core FunctionsΒΆ
VCheck provides several functions for quickly checking the version of a given module:
check_raise(mod[, hexsha, version, verbose]) |
Raises an error if a given Python module does not match a particular git sha1 signature or version. |
check_warn(mod[, hexsha, version, verbose]) |
Warns if a given Python module does not match a particular git sha1 signature or version. |
vcheck(mod[, hexsha, version]) |
Checks a given module against either a git sha1 signature or a version. |
It is possible to raise an error with check_raise, a warning
with check_warn, or to obtain a boolean with vcheck:
Example
Version-checking VCheck:
>>> if vcheck.vcheck(vcheck, version='0'): print('Not version 0')
Not version 0
>>> vcheck.check_warn(vcheck, version='0')
__main__:1: UserWarning: VersionError: Repo for module vcheck is dirty (changes have been made); version not well-defined.
>>> vcheck.check_raise(vcheck, version='0')
Traceback (most recent call last):
...
vcheck.versionerror.VersionError: Repo for module vcheck is dirty (changes have been made); version not well-defined.