State
TemplateVersionAnswer
dataclass
¶
Source code in nava/platform/templates/state.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
answer_value
instance-attribute
¶
What is saved in the answers file as _commit
(it's the output from a git describe
)
display_str
property
¶
Public facing representation of the version.
copier.Template.version
/the PEP 440 value is what Copier uses in its
messaging ("Updating to template version
version
instance-attribute
¶
A PEP 440 object corresponding to answer_value
(if possible)
get_version_from_git_describe(v)
¶
Parse the string as a Version
.
This is an imperfect, but minimally-complicated effort to match
copier.Template.version
behavior. It mostly diverges from the upstream
value when version string is not a valid PEP 440 identifier (e.g., the
template uses a date stamp as it's version), as we can't fully match
Copier's behavior without access to the full git history, since upstream
discards all tags that are not PEP 440 compliant before generating its value
(and if there are no PEP 440 compliant tags at all in the template, will
spit out something like: 0.0.0.post<count of commits since beginning of
project>.dev0+<current commit short hash>
).
Source code in nava/platform/templates/state.py
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 |
|