<story><title>Maintain a clean architecture in Python with dependency rules</title><url>https://sourcery.ai/blog/dependency-rules/</url></story><parent_chain></parent_chain><comment><author>hbrn</author><text>This (plus Law of Demeter) is the right way to handle medium-big size projects, though I&amp;#x27;m not completely sold on the tooling. I mostly do it manually (yes, it is still doable with dozens of modules since dependency hierarchy doesn&amp;#x27;t change often).&lt;p&gt;One recommendation I have is to present the hierarchy as DAG. Existing image (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;sourcery.ai&amp;#x2F;static&amp;#x2F;05300f06cb847360719e2aa31dc5a31b&amp;#x2F;8c857&amp;#x2F;dependencies.png&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;sourcery.ai&amp;#x2F;static&amp;#x2F;05300f06cb847360719e2aa31dc5a31b&amp;#x2F;...&lt;/a&gt;) doesn&amp;#x27;t make it very obvious that api is a highest-level module, even though it is clearly stated in the rules.</text></comment>
<story><title>Maintain a clean architecture in Python with dependency rules</title><url>https://sourcery.ai/blog/dependency-rules/</url></story><parent_chain></parent_chain><comment><author>hakanderyal</author><text>After dealing with that problem and enduring the pain of it for years, I finally switched to C#&amp;#x2F;.NET. It has the necessary tooling to achieve this and more.&lt;p&gt;Rewriting a lot of things was time well spent rather than trying to tame the dynamic nature of Python and my tendency to overuse it.&lt;p&gt;And I can&amp;#x27;t believe I&amp;#x27;m writing this after all these years evangelizing Python and dynamically typed languages.</text></comment>