Sunday, December 08, 2019

pydeps: a very useful program

A few weeks ago, I was doing some refactoring of Friendly-traceback and had some minor difficulty in avoiding the creation of circular imports.  For some reason (age perhaps), I could not visualize the file structure properly.  Enter pydeps.  After I used it to generate a graph for all the files internal to Friendly-traceback, I was able to use that graph to figure out a better way to structure my program.

Today, as I stared at that graph, after including it in the newly styled documentation, I noticed that the "version" file I had created early on, was really redundant since its content (a single variable) could easily be incorporated in the Public API file.



So, one less file to deal with!

I think I am going to use pydeps a lot more from now on when I want to try to understand the how projects are structured, as I do find this type of graph very useful.

2 comments:

  1. Saw this post on HN, ended up discovering the Friendly-Tracebacks project. Amazing approach to improve the developer experience.
    I still like the version.py with a single variable, but that's just because it makes it easier to parse the source code safely with the ast module and extract the version, all from my setup.py. But that's just me :)

    I'll be using Friendly-Exceptions soon and I'm thinking about making it a first-class citizen of UIClasses https://uiclasses.readthedocs.io/en/latest/api.html

    ReplyDelete