Skip to content

2.3.0 — Carta marina edition

Choose a tag to compare

@Technologicat Technologicat released this 01 Apr 23:18
· 143 commits to master since this release

New features

  • File exclusion (-x / --exclude) — exclude files matching glob
    patterns before analysis. Patterns without a path separator match
    against the basename (e.g. test_*.py); patterns with a separator
    match against the full path (e.g. */tests/*). Available in both
    call-graph and module-level modes, via CLI, Python API (exclude
    parameter in create_callgraph / create_modulegraph), and the
    Sphinx directive (:exclude: option, comma-separated).
    (#119 — thanks @lightswitch05)

  • Class-level constant attribute access — accessing class constants
    (e.g. Color.RED on an Enum, or Config.DEBUG) now creates a uses
    edge to the class itself, so these classes no longer appear
    disconnected in the graph. (#113)

  • Sans-IO analysis via from_sourcesCallGraphVisitor.from_sources()
    and create_callgraph(sources=...) accept (source_text, module_name)
    pairs (or (ast.Module, module_name)) for analysis without any file
    I/O. Useful for embedding pyan in tools that already have source text
    in memory, or for analyzing ASTs from macro expanders.
    (#101 — thanks @tristanlatr)

  • Per-anonymous-scope isolation — multiple lambdas or comprehensions
    in the same function no longer share a single scope. Each instance
    now gets a numbered scope key (e.g. listcomp.0, listcomp.1),
    preventing the second instance's bindings from overwriting the first's.
    Works on both pre-3.12 (symtable-based) and 3.12+ (PEP 709 synthetic)
    scope paths. (#110)

  • Module-graph multi-project coloring — modules are now colored by
    top-level directory relative to the project root, matching the
    call-graph analyzer's approach. Previously, modules from different
    projects could share colors if their immediate parent directories
    had the same name. (#111)

  • Class-prefixed method labels when ungrouped — when grouping is off,
    method labels are now prefixed with the class name (e.g. MyClass.run
    instead of just run), making it possible to tell which class a method
    belongs to without annotations. (#112)


Install: pip install pyan3==2.3.0

Full changelog: CHANGELOG.md