You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/version_source.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,26 @@ You may configure the following options under `[tool.uv-dynamic-versioning]`:
148
148
"""
149
149
```
150
150
151
+
- `format-jinja-imports` (array of tables, default: empty):
152
+
This defines additional things to import and make available to the `format-jinja` template.
153
+
Each table must contain a `module` key and may also contain an `item` key. Consider this example:
154
+
155
+
```toml
156
+
format-jinja-imports = [
157
+
{ module = "foo" },
158
+
{ module = "bar", item = "baz" },
159
+
]
160
+
```
161
+
162
+
This is roughly equivalent to:
163
+
164
+
```python
165
+
import foo
166
+
from bar import baz
167
+
```
168
+
169
+
`foo` and `baz` would then become available in the Jinja formatting.
170
+
151
171
- `style` (string, default: unset): One of: `pep440`, `semver`, `pvp`. These are pre-configured output formats. If you set both a `style` and a `format`, then the format will be validated against the style's rules. If `style` is unset, the default output format will follow PEP 440, but a custom `format` will only be validated if `style` is set explicitly.
152
172
Regardless of the style you choose, the dynamic version is ultimately subject to Hatchling's validation as well, and Hatchling is designed around PEP 440 versions. Hatchling can usually understand SemVer/etc input, but sometimes, Hatchling may reject an otherwise valid version format.
153
173
- `latest-tag` (boolean, default: false): If true, then only check the latest tag for a version, rather than looking through all the tags until a suitable one is found to match the `pattern`.
0 commit comments