Skip to content

Releases: Technologicat/pyan

Version 1.2.0

11 Feb 13:28
Compare
Choose a tag to compare

Starting with this release, Pyan is now jointly maintained by @Technologicat, @jdb78, and @johnyf.

New:

  • Sphinx extension.

Changed:

  • Improve package root resolution.

Fixed:

  • #62: visit_AnnAssign crash on an empty list.

Version 1.1.1

10 Dec 22:34
Compare
Choose a tag to compare

This version adds HTML and SVG export by @jdb78, several small fixes by @johnyf, some individual fixes by other community members, and most importantly, brings the long-outdated PyPI package back into sync with this development repo.

Thanks to everyone who contributed to this release!

Version 1.0.4

25 Jun 22:00
Compare
Choose a tag to compare

Bugfix release: fix #7, #8, #9.

Thanks to @matt-kempster and @fcabaud for bug reports!

Version 1.0.3

25 Jun 09:56
Compare
Choose a tag to compare

Packaged with setuptools and uploaded to PyPI.

Script name is now pyan3.

Pyan3 v1.0.2

03 Jan 14:06
Compare
Choose a tag to compare

Bugfix:

  • fix regression: keep wildcard if the 'resolved' target is actually an unresolved function argument

Enhancements:

  • add --grouped-alt (-G) to make invisible defines edges to suggest grouping for GraphViz, without actually placing the nodes into GraphViz clusters. Overrides --no-defines. Overridden by --defines.
  • analyze str() and repr() if the argument is a Name or Attribute mapping to a known Node.
  • add uses edge to result from a resolved call to built-ins, important for str() and repr()

Pyan3 v1.0.1

21 Nov 11:35
Compare
Choose a tag to compare

Bugfixes:

  • crash in analyzer when resolving super() call with no known bases
  • crash in collapse_inner() during postprocessing
  • use /usr/bin/env python3 instead of hard-coded /usr/bin/python3 in hashbang in pyan.py to support virtualenvs correctly

Enhancements:

  • analyze the with statement: add uses edges from the node containing the with block to __enter__ and __exit__ methods of the with'd object; also track binding from with ... as foo (single target only for now, and __enter__ is assumed to return self)
  • analyze instantiation: add a uses edge to MyClass.__init__ for a call to MyClass()
  • node flavoring both in analysis and in output (class, function, method, staticmethod, classmethod)
  • figure out which names correspond to arguments in FunctionDef; prevent leakage of matching names from the enclosing scope. This fixes some spurious edges.
  • avoid adding a uses wildcard when resolving super() fails. This fixes spurious, possibly seemingly recursive, uses edges in the case that part of the class hierarchy is not available for analysis. (The most common reasons for super() resolution to fail are that either the analyzer is still running pass 1 [MRO is computed between passes], or some relevant source file is not in the analyzed set.)

Technical improvements:

  • refactor analyzer: split into the main class and anutils
  • reorder methods in the analyzer main class to make the source code more logical to read for humans

Pyan3 v1.0.0

21 Nov 11:23
Compare
Choose a tag to compare

Python 3 compatibility.

Changes w.r.t. the long-standing version of Pyan for Python 2, davidfraser/pyan@26faced :

  • rewrite analyzer in Python 3, using ast and symtable
  • unlimited number of hues for output graph nodes
  • graph node hue is now based on filename, not top-level namespace
  • detailed (debug) logging with --very-verbose, can be abbreviated to -V
  • treat __init__ like any method (now shows up in the output graph)
  • add uses edges for recursive calls
  • analyze nested class definitions
  • define "self" by capturing the name of the first argument of methods and class methods, like Python does
  • analyze nested attribute accesses (e.g. self.a.b)
  • look up inherited attributes (using MRO with C3 linearization, based on static type at use site)
  • analyze super() calls
  • recognize for as a binding form to avoid name clashes between loop counters and functions defined elsewhere (however, can fail if the expression to be assigned is complex enough)
  • analyze simple item-by-item tuple assignments x,y,z = a,b,c and pythonic swap a,b = b,a
  • analyze chained assignments a = b = c
  • in analysis, use local scope for lambda, listcomp, setcomp, dictcomp, genexpr to follow Python 3 scoping rules correctly; for visualization, contract these into the parent node in postprocessing
  • yEd GraphML output support, framework for easily adding new output formats (merge PR #1 from davidfraser/pyan)
  • bugfix for unsafe graph node identifiers, fix inspired by davidfraser/pyan@ddb62d2
  • refactor code into modules for easier maintenance