Currently, build_graph requires the passed package to be a top-level package, or, in the case of native namespace packages, the portion. The downsides of this are:
- There is no way of building the graph for all portions under a given namespace package - they have to be specified explicitly. (e.g.
build_graph("namespace.one", "namespace.two")).
- If you want to explore only part of the graph, you still need to build the whole thing. E.g. if you want to analyze
mypackage.foo then you need to build mypackage.
- Understanding what package to pass can be confusing.
It should be possible to support arbitrary packages:
- If we supply a namespace, we can discover all the portions on the graph.
- If we supply a (non-portion) subpackage, we can treat imports of modules outside that package as external packages.
Currently,
build_graphrequires the passed package to be a top-level package, or, in the case of native namespace packages, the portion. The downsides of this are:build_graph("namespace.one", "namespace.two")).mypackage.foothen you need to buildmypackage.It should be possible to support arbitrary packages: