Login
You're viewing the front-end.social public feed.
  • Dec 8, 2025, 7:33 PM

    findimports 3.0.0 is out with bugfixes and improvements.

    /jk

    It can now do a transitive reduction of your Python import graph, making them much more readable in graphviz. Eg..

    uvx findimports -q -N --tred -d ~/src/check-python-versions/src -R check_python_versions | xdot -

    Import graph of check_python_versions import dependencies.  Top level contains __main__ and three more modules, not connected to the rest of the graph (check_python_versions, parsers, sources)

The second row has cli, with an arrow from __main__ above pointing to it.

The third has 'sources.all' with an arrow from cli above pointing to it.

The fourth has sources.appveyor, sources.github, sources.travis, sources.manylinux, all with arrows from sources.all pointing to them.

The fifth has parsers.yaml and sources.tox, with arrows from the first three of the above boxes pointing to both.  It also has sources.setup_py and sources.pyproject, with arrows from sources.all pointing to them.

The sixth row has parsers.ini, sources.base, parsers.python, parsers.requires_python, parsers.classifiers, and parsers.poetry_version_spec, with various arrows pointing to them.

The seventh and last row has just two modules: utils and versions.  Both have a lot of arrows pointing to them.
    💬 1🔄 4⭐ 0

Replies

  • 💬 1🔄 0⭐ 1
  • Dec 8, 2025, 7:35 PM

    Previously I always used graphviz's tred to preprocess the import graph produced by findimports to get this, but now findimports can do it by itself.

    💬 1🔄 0⭐ 0
  • Dec 8, 2025, 7:36 PM

    Also, there was a bugfix where findimports used to get confused about modules called packagename.__init__ and not realize that other modules using from packagename import thing might've been importing things from packagename.__init__.

    Now these are recognized and shown as packagename without the __init__ suffix.

    (This is not backwards-compatible hence the version number bump to 3.0.0.)

    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0