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:
111111getter = " mypackage.version:get_version('dev')"
112112```
113113
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+
114130### Writing dynamic version to file
115131
116132You 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