versionmgr
Utility functions for managing pyRevit versions.
Examples:
'4.10-beta2'Attributes
mlogger = get_logger(__name__)
module-attribute
VERSION_REGEX = '\\A(\\d+)\\.(\\d+)\\.(\\d+)\\.?(.+)?\\Z'
module-attribute
Functions:
parse_version_string(version_string)
Split a version string into (major, minor, patch, metadata) parts.
The whole value has to be a version. An unanchored match would let a malformed session value contribute a version to the string the About window shows, which is the same class of stale report this module exists to prevent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version_string
|
str
|
version string, e.g. "7.0.0.26273+1554" |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
(int, int, int, str) parts, or None if the string is not a version |
Source code in pyrevitlib/pyrevit/versionmgr/__init__.py
get_loaded_build_version()
Version of the build the running session loaded, or None.
The loader seeds PYREVIT_VERSION from the informational version of the loaded
pyRevit Runtime assembly, so this is the build actually executing in Revit. The
version file in the clone describes the checkout instead, and the two disagree
whenever the clone's bin/ came from a release image or from CI artifacts.
Returns:
| Type | Description |
|---|---|
str
|
version string of the loaded build, or None outside a session |
Source code in pyrevitlib/pyrevit/versionmgr/__init__.py
get_pyrevit_repo()
Return pyRevit repository.
Returns:
| Type | Description |
|---|---|
RepoInfo
|
repo wrapper object |
Source code in pyrevitlib/pyrevit/versionmgr/__init__.py
get_pyrevit_version()
Return information about active pyRevit version.
The version reported is the one stamped into the assemblies the session loaded, falling back on the clone's version file when no session is running.
Returns:
| Type | Description |
|---|---|
_PyRevitVersion
|
version wrapper object |
Source code in pyrevitlib/pyrevit/versionmgr/__init__.py
get_pyrevit_cli_version()
Return version of shipped pyRevit CLI utility.
Returns:
| Type | Description |
|---|---|
str
|
version string of pyRevit CLI utility binary |