Skip to content

Commit cfc7199

Browse files
henryiiijcfr
andauthored
Apply suggestions from code review
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
1 parent 0fa1b2a commit cfc7199

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ include that in your requirements. Make sure the version is marked dynamic in
5454
your project table. And then you specify `version.provider`. The other options
5555
are defined by the plugin; this one takes a required `input` file and an
5656
optional `regex` (which defaults to the expression you see above). The regex
57-
needs to have a `"value"` named group, which it will set.
57+
optional `regex` (which defaults to the expression you see above). The regex
58+
needs to have a `"value"` named group (`?P<value>`), which it will set.
5859

5960
## For plugin authors
6061

@@ -120,6 +121,8 @@ def dynamic_metadata(
120121
raise RuntimeError("Must set 'input' and/or 'regex' to strings")
121122

122123
input = settings["input"]
124+
# If not explicitly specified in the `tool.dynamic-metadata.v1.<field-name>` table,
125+
# the default regex provided below is used.
123126
regex = settings.get(
124127
"regex", r'(?i)^(__version__|VERSION) *= *([\'"])v?(?P<value>.+?)\2'
125128
)

0 commit comments

Comments
 (0)