Hotfix release.
Fixed
-
--module-levelno longer drops every dependency on a package itself. A package's__init__.pywas registered under the namepkg.__init__, whileimport pkgrecords a dependency onpkg— so the edge pointed at a module that, as far as the graph was concerned, did not exist, and was discarded without a warning. Both directions went: a module importing a name re-exported frompkg/__init__.pyshowed no dependency at all, and the package's own imports vanished with the node they started from.- The
__init__is now drawn as the package, under the namepkg.--initstill draws it separately aspkg.__init__, together with the implicit dependency every module under the package has on it — which is what the default omits, and what it was trying to omit all along. - An
__init__.pynaming its own package —from harbor import quay, written inharbor/__init__.py— resolves to the module the import is written in, and draws nothing. A module does not depend on itself. - Still missed:
from . import thing, wherethingis a name defined in__init__.pyrather than a submodule. Recorded inTODO_DEFERRED.md, along with the cycle report naming a packagepkg.__init__where the graph now sayspkg.
- The
-
Ungrouped output now names a module by its dotted path.
--module-levellabelled modules with their short name, so in a project with several packages holding autilsor anapp, distinct modules printed identically and--textran their entries together as though they were one. Grouped output was unaffected, the cluster title supplying the package; so was the call graph, which builds module nodes with the whole path in the name. That is now the form both use. -
A misspelled option is now an error instead of being ignored. Filenames are whatever the argument parser does not claim, so
--with-init— a plausible misspelling of--init— was taken for a glob, matched nothing, and left pyan running with the setting the user was trying to change. Both the call graph and--module-levelwere affected. A glob matching no files is likewise an error in--module-levelnow, as it already was for the call graph. -
What the graph leaves out now describes grouped output correctly, and gives an example of each rule. Every module is drawn as a box under
--grouped; the README said a module without members stays a plain node, which it does not — an empty__init__.pygets a box holding<module>alone. Only the first of the culling rules came with an example, so the rest have one now.- It also warns that folding a lambda or comprehension into its enclosing function hides a scope boundary Python really has, so a call made inside one cannot be told from a call in the function body. Name resolution is unaffected — a lambda parameter or comprehension target shadows the enclosing binding, as it should.