File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,22 @@ You can also supply it with literal arguments:
111
111
getter = " mypackage.version:get_version('dev')"
112
112
```
113
113
114
+ !!! note
115
+
116
+ The module that the version getter function is in
117
+ [must be importable *before* installation](https://github.com/pdm-project/pdm/issues/3385#issuecomment-2632705361).
118
+ If you are using a `src` layout, you must specify the function like this:
119
+
120
+ ```toml
121
+ getter = "src.mypackage.version:get_version"
122
+ ```
123
+
124
+ Or put it in a package outside the target package, e.g. in a `scripts/` directory in the repository root.
125
+
126
+ ```toml
127
+ getter = "scripts.version:get_version"
128
+ ```
129
+
114
130
### Writing dynamic version to file
115
131
116
132
You can instruct ` pdm-backend ` to write back the dynamic version to a file. It is supported for all sources but ` file ` .
You can’t perform that action at this time.
0 commit comments