version_utils
Machinary for the IO of configuration YAML files and their validation.
Functions:
| Name | Description |
|---|---|
parse_config |
str, config_path: str) -> TaskParameters: Parse a configuration file and return a TaskParameters object of validated parameters for a specific Task. Raises an exception if the provided configuration does not match the expected model. |
Raises:
| Type | Description |
|---|---|
ValidationError
|
Error raised by pydantic during data validation. (From Pydantic) |
_record_git_commit_hash(location)
Collect the git commit hash of the specified repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str
|
Full path to the repository. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
commit_hash |
str
|
The git commit hash as a string. |
Source code in lute/io/version_utils.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
_record_git_diff(location, diff_args=None)
Collect the diff of the specified repository and then compress and encode it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str
|
Full path to the repository. |
required |
diff_args
|
Optional[List[str]]
|
A list of arguments to pass to git diff. E.g. can specify to exclude folders, ignore permission changes etc. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
enc_str |
str
|
The compressed, b64 encoded, diff as a string. |
Source code in lute/io/version_utils.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
record_version(version_specifier=0, location=None, diff_args=None)
Record version information for an execution of a Task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version_specifier
|
int
|
Bitwise OR combination of VersionSpecifier enums. |
0
|
location
|
Optional[str]
|
Location of the git repository. Defaults to the LUTE repository. |
None
|
diff_args
|
Optional[List[str]]
|
A list of arguments to pass to git diff. E.g. can specify to exclude folders, ignore permission changes etc. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
version_info |
Dict[str, str]
|
A dictionary of version details. |
Source code in lute/io/version_utils.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |