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
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,7 @@ You may configure the following options under `[tool.uv-dynamic-versioning]`:
149
149
```
150
150
151
151
- `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
+
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.
152
153
- `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`.
153
154
- `bump` (boolean or table, default: false): If enabled, then increment the last part of the version `base` by 1, unless the `stage` is set, in which case increment the `revision` by 1 or set it to a default of 2 if there was no `revision`. Does nothing when on a commit with a version tag. One of:
154
155
@@ -187,12 +188,33 @@ You may configure the following options under `[tool.uv-dynamic-versioning]`:
187
188
If set, use this regular expression to extract the version from the file.
188
189
The first capture group must contain the version.
189
190
190
-
Simple example:
191
+
### Examples
192
+
193
+
Default (no `tool.uv-dynamic-versioning`in`pyproject.toml`):
194
+
195
+
```bash
196
+
$ git tag v1.0.0
197
+
$ uv build
198
+
Building source distribution...
199
+
Building wheel from source distribution...
200
+
Successfully built dist/foo-1.0.0.tar.gz
201
+
Successfully built dist/foo-1.0.0-py3-none-any.whl
202
+
```
203
+
204
+
With `pattern`:
191
205
192
206
```toml
193
207
[tool.uv-dynamic-versioning]
194
-
vcs = "git"
195
-
style = "semver"
208
+
pattern = "default-unprefixed"
209
+
```
210
+
211
+
```bash
212
+
$ git tag 1.0.0
213
+
$ uv build
214
+
Building source distribution...
215
+
Building wheel from source distribution...
216
+
Successfully built dist/foo-1.0.0.tar.gz
217
+
Successfully built dist/foo-1.0.0-py3-none-any.whl
0 commit comments