
Pydeps: A Useful Program - luord
https://aroberge.blogspot.com/2019/12/pydeps-very-useful-program.html
======
closed
I'm a huge fan of pydeps! Recently, I have been using it to discuss with
developers the structure of their code. Being able to quickly show them how
interconnected their imports are, and ask which of the "lines" they might
remove is a great teaching tool.

Cutting out "lines" isn't always the right decision, but it's been helpful to
visualize and discuss.

------
fermigier
My projects use a bit of dynamic imports (Flask blueprints imported using
`werkzeug.import_string`. From a quick trial, pydeps only works with static
imports. A similar project (or the same one!) which collects data at runtime
would be useful in this case.

------
qwerty456127
> "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.

What if it was not? How would you re-structure the program in that case?

As for me program structure is the hardest part of Python and I haven't seen a
single Python program which's structure wouldn't look at least slightly ugly
to me.

------
kapilvt
Pipdeptree is another useful tool in this vein except cli driven on display.
Poetry as a package manager also has some ice built is via their show sub
command.

[https://github.com/naiquevin/pipdeptree](https://github.com/naiquevin/pipdeptree)

~~~
nurettin
How do you use pipdeptree or poetry --tree to see which files in your project
depend on which?

~~~
remram
You can see which package depends on which package, if that dependency is
declared in the package's metadata. But nothing at the file level.

