News for hackers. Stuff that matters.
Re:Show HN: Tach – Visualize and Untangle Your Python Codebase by tracnar on Wednesday February 26, 2025 @03:12PM (#43187686)
When I tried it, it seemed like you really need to list all modules in `tach.toml`.

What I wanted was to work at a coarser package level. For example if you have the modules `foo.a`, `foo.b`, `bar.a`, and `bar.b`, I'd like a rule that `bar` can import from `foo` but not vice versa, without having to list or care about the submodules.

Is that something you'd want to support?

Re:Show HN: Tach – Visualize and Untangle Your Python Codebase by 0x63_Problems on Wednesday February 26, 2025 @03:25PM (#43187802)
This should definitely be supported out-of-the-box, we can take a closer look in Discord or through GH Issues! But generally I would expect:

```

[[modules]]

path = "foo"

depends_on = []

[[modules]]

path = "bar"

depends_on = ["foo"]

```

would do the trick, assuming both are within a configured source root, and their children are _not_ also marked as modules. If the children are marked as modules, their dependency rules are treated separately and wouldn't automatically inherit from a parent.

Re:Show HN: Tach – Visualize and Untangle Your Python Codebase by tracnar on Wednesday February 26, 2025 @03:49PM (#43188045)
Ok great, I indeed just tried, I might just have been confused last time! Maybe you could mention in the doc that a module can be a "package"? (Even though I suppose a package is also a module, I always find the Python terminology a bit confusing there.)
Re:Show HN: Tach – Visualize and Untangle Your Python Codebase by rswail on Thursday February 27, 2025 @07:15AM (#43193655)
I always used to think of it as a module is a file `example.py`, a package is a directory `example` with a module `__init__.py`.