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
I really want to see this happening because it makes much harder to keep pyproject.toml synchronized across projects. Sadly TOML file format does not have support for generic substitutions like tox has. It only supports environment variables substitutions which is of no use for us, as we need to refer to refer to project.name and also to normalize the value as the name might be foo-bar, and it should translate to foo_bar.
On the other hand, I wonder if we could have another generic approach that does not need that and that will use the first module directory, mile write_to = "{module_dir}/_version.py"- module_dir should resolve to ./src/foo_bar.
Any suggestions about approaches that could be implemented easily? -- We don't have to cover for multi-module care from start, as it a very uncommon layout.
Update
I recently sorted another duplication in pyproject.toml by using via
[tool.ruff.lint.isort]
known-first-party = ["src"] # <-- used to be hardcoded name of the package
This makes me think that maybe using glob could be found suitable and also cover for the case where we have multiple python modules:
unfortunately current packaging practices make it necessary to have the package name yet again in the src folder
practically this means people have to spell the package name in the write_to parameter
they should be able to do something like
Originally suggested by @smarie in #582 (comment)
ideally in future src will directly map to the toplevel of a package
The text was updated successfully, but these errors were encountered: