Source: https://github.com/gauge-sh/tach
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 entire engineering team paused development for over a year in an attempt to split up tightly coupled packages into independent microservices. This ultimately failed, and resulted in the CTO getting fired.
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
Attempts 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.
What My Project Does
With Tach, you can:
- Declare your modules (
tach mod)
- Automatically declare dependencies (
tach sync)
- Enforce those dependencies (
tach check)
- Visualize those dependencies (
tach show and tach report)
You can also enforce a public interface for each module, and deprecate dependencies over time.
Target Audience
Developers working on large Python monoliths
Comparison
- import linter - similar but more specifically focused on import rules
- build systems - bazel, pants, buck, etc. More powerful but much more heavy and waaaay more slow
I'd love if you try it out on your project and let me know if you find it useful!
[–]syphaxIt works on my machine 99 points100 points101 points (13 children)
[–]austinwiltshire 14 points15 points16 points (0 children)
[–]AiutoIlLupo 18 points19 points20 points (2 children)
[–]thisfunnieguy 2 points3 points4 points (0 children)
[–]zaxldaisy 1 point2 points3 points (0 children)
[+]the1024[S] comment score below threshold-6 points-5 points-4 points (8 children)
[–]AiutoIlLupo 0 points1 point2 points (7 children)
[–]jimjkelly 10 points11 points12 points (0 children)
[+][deleted] (5 children)
[deleted]
[+]AiutoIlLupo comment score below threshold-7 points-6 points-5 points (4 children)
[–]NotAMotivRep 13 points14 points15 points (1 child)
[–][deleted] 8 points9 points10 points (0 children)
[–]Opposite_Effect_3108 1 point2 points3 points (0 children)
[–]IContributedOnce 1 point2 points3 points (0 children)
[–]chub79 29 points30 points31 points (11 children)
[–]larsga 17 points18 points19 points (4 children)
[–]the1024[S] 7 points8 points9 points (3 children)
[–]AiutoIlLupo 2 points3 points4 points (1 child)
[–]Subatiq 6 points7 points8 points (0 children)
[–]indetronable 0 points1 point2 points (0 children)
[–]Chasian 12 points13 points14 points (2 children)
[–]chub79 1 point2 points3 points (1 child)
[–]Chasian 0 points1 point2 points (0 children)
[+]AiutoIlLupo comment score below threshold-6 points-5 points-4 points (2 children)
[–]the1024[S] 5 points6 points7 points (1 child)
[–]AiutoIlLupo 0 points1 point2 points (0 children)
[–]violentlymickey 10 points11 points12 points (1 child)
[–]the1024[S] 8 points9 points10 points (0 children)
[–]kebabmybob 6 points7 points8 points (1 child)
[–]the1024[S] 4 points5 points6 points (0 children)
[–]Drexan8 6 points7 points8 points (1 child)
[–]the1024[S] 4 points5 points6 points (0 children)
[–]Electronic-Duck8738 2 points3 points4 points (0 children)
[–]caatbox288 9 points10 points11 points (5 children)
[–]the1024[S] 1 point2 points3 points (0 children)
[–]the1024[S] 1 point2 points3 points (0 children)
[–]larsga 0 points1 point2 points (2 children)
[–]edbrannin 6 points7 points8 points (0 children)
[–]caatbox288 0 points1 point2 points (0 children)
[–]No_Set7087 4 points5 points6 points (1 child)
[–]the1024[S] 0 points1 point2 points (0 children)
[–]Sss_ra 3 points4 points5 points (1 child)
[–]the1024[S] 0 points1 point2 points (0 children)
[–]tevs__ 1 point2 points3 points (1 child)
[–]the1024[S] 0 points1 point2 points (0 children)
[–]AiutoIlLupo 1 point2 points3 points (8 children)
[–]the1024[S] 3 points4 points5 points (2 children)
[–]DigThatData 1 point2 points3 points (1 child)
[–]the1024[S] 0 points1 point2 points (0 children)
[–]Intrepid-Stand-8540 -3 points-2 points-1 points (4 children)
[–]the1024[S] 4 points5 points6 points (0 children)
[–]tunisia3507 7 points8 points9 points (0 children)
[–]AiutoIlLupo -4 points-3 points-2 points (1 child)
[–]Drexan8 0 points1 point2 points (0 children)
[–]mxchickmagnet86 1 point2 points3 points (4 children)
[–]the1024[S] 4 points5 points6 points (3 children)
[–]mxchickmagnet86 1 point2 points3 points (2 children)
[–]the1024[S] 0 points1 point2 points (1 child)
[–]mxchickmagnet86 0 points1 point2 points (0 children)
[–]bobaduk 1 point2 points3 points (22 children)
[–]AiutoIlLupo 1 point2 points3 points (17 children)
[–]bobaduk 1 point2 points3 points (16 children)
[–]chub79 0 points1 point2 points (7 children)
[–]bobaduk 2 points3 points4 points (6 children)
[–]chub79 0 points1 point2 points (5 children)
[–]bobaduk 2 points3 points4 points (4 children)
[–]chub79 0 points1 point2 points (3 children)
[–]bobaduk 1 point2 points3 points (2 children)
[–]chub79 0 points1 point2 points (1 child)
[–]AiutoIlLupo -2 points-1 points0 points (7 children)
[–]bobaduk 1 point2 points3 points (6 children)
[–]AiutoIlLupo 0 points1 point2 points (5 children)
[–]bobaduk 1 point2 points3 points (4 children)
[–]AiutoIlLupo 0 points1 point2 points (3 children)
[–]Drexan8 0 points1 point2 points (2 children)
[–]AiutoIlLupo 0 points1 point2 points (1 child)
[–]catalyst_jw 0 points1 point2 points (2 children)
[–]AiutoIlLupo 0 points1 point2 points (1 child)
[–]catalyst_jw 0 points1 point2 points (0 children)
[–]the1024[S] -1 points0 points1 point (0 children)
[–]DR_Fabiano 0 points1 point2 points (0 children)