Now that PEP 735 has been accepted, it would be great to support it in tach. Specially given that uv already supports
dependency-groups.
In our use case we have several groups to better control out dependencies, for example we have a test group and a scripts group.
We are currently checking external dependencies with the command uv run tach check-external -e "**/*test*,**/scripts", because otherwise tach complains that pytest and other dependencies are not available.
My proposal is to add support for dependency groups in the following way to the tach.toml config file:
[external.groups]
scripts = ["**/scripts"]
test = ["**/*test*.py"]
Which would mean that files matching **/scripts would also have access to the dependencies defined in the scripts group.
Note that in the proposal above, dependencies present in the default group will be available to all files.
I could see how that may not fit all use cases, and maybe a more flexible approach would be to define it the other way around, as in
[external.groups]
"**/scripts" = ["scripts", "default"]
"**/*test*.py" = ["test", "default"]
"*" = ["default"]
In that approach, we would map file patterns to available groups, where patterns are matched from the top.
Now that PEP 735 has been accepted, it would be great to support it in tach. Specially given that
uvalready supportsdependency-groups.
In our use case we have several groups to better control out dependencies, for example we have a
testgroup and ascriptsgroup.We are currently checking external dependencies with the command
uv run tach check-external -e "**/*test*,**/scripts", because otherwise tach complains thatpytestand other dependencies are not available.My proposal is to add support for dependency groups in the following way to the
tach.tomlconfig file:Which would mean that files matching
**/scriptswould also have access to the dependencies defined in thescriptsgroup.Note that in the proposal above, dependencies present in the default group will be available to all files.
I could see how that may not fit all use cases, and maybe a more flexible approach would be to define it the other way around, as in
In that approach, we would map file patterns to available groups, where patterns are matched from the top.