Closed eric-nieuwland closed 1 year ago
What's your use case for excluding the entire standard library? I'm trying to keep the API of modulegraph2 fairly minimal.
Note that the following should work for excluding the standard library in Python 3.10 or later:
graph = modulegraph2.ModuleGraph(...)
graph.add_excludes(sys.stdlib_module_names)
In older versions you have to add the list of standard library names to you script because the sys
attribute is not available.
As a developer I want to see the import graph of my own software, without standard library and possibly without installed packages so I can analyse the import structure of my code as a support for refactoring.
And as I'm using this package through its command line interface I'd like the code snippet above available through the CLI.
Closing this as my recent changeset adds an implementation for this.
Yes, your version is so much cooler than my 10 minutes clutch!
In the current version one needs to exclude each package in the standard library separately. Would be very welcome to be able to exclude the standard library more simply.