pyan3 2.0.0
Changelog
2.0.0 (2026-02-19)
Python 3.10–3.14. This release drops support for Python < 3.10.
New features
-
Module-level import dependency analysis —
--module-levelCLI flag and
create_modulegraph()Python API.- Visualizes which modules import which, with import cycle detection (
-C/--cycles). - This replaces the previous separate
modvis.pythat used to live at the project root. - This analyzer now supports
--root— explicit project root directory; inferred by default
(walks up past__init__.pydirectories).
- Visualizes which modules import which, with import cycle detection (
-
Supports all new syntax added after Python 3.6, up to and including 3.14.
typestatement (PEP 695 type aliases, including parameterized aliases)
and inlined comprehension scopes.- Walrus operator (expression assignment,
:=) — tracked as both a use
(RHS) and a definition. async with—__aenter__/__aexit__protocol edges.matchstatement — class patterns, guard expressions, and body calls.- Type annotations —
AnnAssign, function argument/return annotations,
and class-body annotations generate "uses" edges.
-
All five output formats (
dot,svg,html,tgf,yed) available
from bothcreate_callgraph()andcreate_modulegraph()APIs.
Internal/maintainability improvements
- Modernized build system (hatchling via
pyproject.toml). - Eliminated internal
self.last_valuestate — analysis uses return values
and_bind_target()throughout. - Deduplicated
create_callgraph()/main()analysis pipeline via shared
_build_graph(). resolve()(modvis) now uses keyword-only parameters.sanitize_exprsrenamed tocanonize_exprs(the function canonicalizes,
it does not sanitize).- Comprehensive test suite: 94 tests (90 on 3.10, 94 on 3.12+), 73% coverage.
- CI: GitHub Actions matrix (3.10–3.14), flake8 lint, Codecov integration.
- Zero flake8 warnings across the codebase.
- Sphinx extension verified and smoke-tested with current Sphinx.
Bug fixes
- Fix CLI crash on relative paths (contributed by Joenio Marques da Costa).
- Fix
CallGraphVisitorpositional arguments issue (contributed by kuuurt). - Fix modvis
from-import to detect submodule dependencies. - Fix modvis
filename_to_module_namecwd fragility — paths are now made
relative to an inferred (or explicit) project root.
Contributors
Thanks to kuuurt, Joenio Marques da Costa (analizo), and A M (BackBenchDevs)
for contributions included in this release.
Thanks also to Anthropic for Claude Opus 4.6 and Claude Code.
1.2.0 (2021-02-11)
Last 1.x release.
The last compatible language version was Python 3.6.
See the git history for details.