Closed h0uter closed 3 weeks ago
EDIT: It looks like this is actually an issue with running a report on a source root directory. This is not a supported usage of tach report
. Instead, it accepts a path to a file or directory within any source root, and will tell you how that module is being used by the rest of the project.
I'll add a more informative error message for this case.
For your workspace, it seems like the source roots for Tach should be configured as the src
directories within each of the src_repos
. Then, you should be able to run tach report
on the child directories (project_a
, project_b
, project_c
) without issue. Please let me know if this works for you!
I'd expected the "source root directory" would be where the pyproject.toml
is located, not the src
subfolder.
Probably related: note that I am using the "src layout" style of setting up my project. So that means that in my pyproject.toml
's there is this line:
[tool.setuptools]
package-dir = { "" = "src" }
This line ensures we don't have to write from src.project_c import ...
but that we can simply write from project_c import ...
.
In my experience, it would have been usefull to see a note in the docs for this on whether "src layout" is also supported and what the recommended setup is for that.
In summary:
old: I had all "source root directory" set to the folders containing the pyproject.toml
... Perhaps I expected tach would see the package-dir = { "" = "src" }
line in pyproject.toml
and figure out the modules are actually located in the src
folders. But in this configuration tach sync
also didn't work...
new: Now I took your advice and set all the "source root directory" to src
in every project and tach sync
appears to work correctly works. So for me it was an onboarding challenge related to using "src layout".
Every folder I run
tach report
for I get this error.Workspace structure