tach - a Python tool to enforce modular design
https://github.com/Never-Over/tach
What My Project Doestach
is a lightweight Python tool that enforces boundaries and dependencies in your Python project. Inspired by nx
, tach
helps you maintain a decoupled and modular Python codebase.
An earlier version of this tool was called modguard, which we shared here.
By default, Python allows you to import and use anything, anywhere. Over time, this results in modules that were intended to be separate getting tightly coupled together, and domain boundaries breaking down. We experienced this first-hand at a unicorn startup, where the eng team paused development for over a year in an attempt to split up packages into independent services. This attempt ultimately failed.
This problem occurs because:
- It's much easier to add to an existing package rather than create a new one
- Junior devs have a limited understanding of the existing architecture
- External pressure leading to shortcuts and overlooking best practices
Efforts we've seen to fix this problem always came up short. A patchwork of solutions would attempt to solve this from different angles, such as developer education, CODEOWNERs, standard guides, refactors, and more. However, none of these addressed the root cause.
With tach
, you can:
1. Declare your packages (package.yml
)
2. Define dependencies between packages (tach.yml
)
3. Enforce those dependencies (tach check
)
You
/r/Python
https://redd.it/1cgsopt
>>Click here to continue<<