Skip to content

2.3.1 — Hotfix

Choose a tag to compare

@Technologicat Technologicat released this 02 Apr 10:37

Bug fixes

  • Relative imports in __init__.py resolve to wrong parent package
    from . import alpha in a nested package init (e.g. pkg/sub/__init__.py)
    resolved to the grandparent (pkg.alpha) instead of the package itself
    (pkg.sub.alpha). Affected all __init__ modules whose fully qualified
    name contains at least one dot. Fixed in both file-based and sans-IO modes.
    (#121 — thanks @tristanlatr)

Notes

  • from_sources(): __init__ naming convention — to get correct relative
    import resolution for package __init__ modules, pass "pkg.sub.__init__"
    as the module name (not just "pkg.sub"). The previous behaviour silently
    produced wrong or missing edges.
  • resolve_import() — new shared utility in pyan.anutils for resolving
    relative imports. Replaces the inline logic in both the call-graph analyzer
    and module-graph analyzer.
  • __all__ added to anutils, main, and modvis modules.

Full changelog: https://github.com/Technologicat/pyan/blob/master/CHANGELOG.md