@@ -67,16 +67,28 @@ In your pyproject.toml file, you may configure the following options:
67
67
* `metadata`: Boolean. Default: unset. If true, include the commit hash in
68
68
the version, and also include a dirty flag if `dirty` is true. If unset,
69
69
metadata will only be included if you are on a commit without a version tag.
70
- * `tagged_metadata `: Boolean. Default: false. If true, include the tagged metadata
71
- discovered as the first of the metadata segments. Requires metatadata to be
72
- true as well to have effect .
70
+ * `tagged-metadata `: Boolean. Default: false. If true, include any tagged
71
+ metadata discovered as the first part of the metadata segment.
72
+ Has no effect when `metadata` is set to false .
73
73
* `dirty`: Boolean. Default: false. If true, include a dirty flag in the
74
74
metadata, indicating whether there are any uncommitted changes.
75
+ Has no effect when `metadata` is set to false.
75
76
* `pattern`: String. This is a regular expression which will be used to find
76
- a tag representing a version. There must be a named capture group `base`
77
- with the main part of the version, and optionally you can also have groups
78
- named `stage` and `revision` for prereleases. The default is
79
- `^v(?P<base>\d+\.\d+\.\d+)(-?((?P<stage>[a-zA-Z]+)\.?(?P<revision>\d+)?))?$`.
77
+ a tag representing a version. There must be a capture group named `base`
78
+ with the main part of the version. Optionally, it may contain another two
79
+ groups named `stage` and `revision` for prereleases, and it may contain a
80
+ group named `tagged_metadata` to be used with the `tagged-metadata` option.
81
+
82
+ The default is:
83
+
84
+ ```re
85
+ (?x) (?# ignore whitespace)
86
+ ^v(?P<base>\d+\.\d+\.\d+) (?# e.g., v1.2.3)
87
+ (-?((?P<stage>[a-zA-Z]+)\.?(?P<revision>\d+)?))? (?# e.g., beta-0)
88
+ (\+(?P<tagged_metadata>.+))?$ (?# e.g., +linux)
89
+ ```
90
+
91
+ Remember that the backslashes must be escaped (`\\`) in the TOML file.
80
92
* `format`: String. Default: unset. This defines a custom output format for
81
93
the version. Available substitutions:
82
94
@@ -180,6 +192,8 @@ In your pyproject.toml file, you may configure the following options:
180
192
text to preserve before and after the replaced text. Default:
181
193
`["(^__version__\s*=\s*['\"])[^'\"]*(['\"])"]`.
182
194
195
+ Remember that the backslashes must be escaped (`\\`) in the TOML file.
196
+
183
197
Simple example:
184
198
185
199
```toml
0 commit comments