Repository navigation
Open
Description
A new codeanalyzer-python release (v1.6.0) is published.
Update the codeanalyzer-python pin in this repo and adapt the
integration to the changes below (see PyCodeanalyzer._run_analyzer).
[1.6.0] - 2026-10-11
Changed
- Level-4 analysis uses about 7x less memory, with the same output (#224). On a
6,685-module project (Odoo 20.0), peak RSS fell from 42.6 GB to 5.7 GB for JSON output,
and from 65.1 GB to 5.5 GB for--emit neo4j. On the same input,analysis.jsonand
the analysis cache have the same content as 1.5.4. The Neo4j snapshot has the same
statements, but edge batches can come in a different order. Representation and lifetime
changes only; no analysis logic changed:- The schema's leaf records are slotted stdlib dataclasses, not pydantic models. This
coversSpan,BodyNode, thecfg/cdg/ddg/summary/param_*edges,PyCallEdge,
PyCallsite,PyCallArgument,PySymbol,PyComment,PyVariableDeclaration,
PyCallableParameter,PyDecoratorandPyImport. The containers (PyModule,
PyClass,PyCallable,PyApplication,Analysis) stay pydantic models. analysis.jsonand the cache are written one module at a time, not as whole-tree
copies. The edge lists are written in chunks. The JSON now uses compact separators
(only whitespace differs).- ASTs, PDG data and the level-4 IR are released as soon as nothing needs them.
- The Neo4j
graph.cyphersnapshot is written in two passes. Nodes are written first,
sorted as before. Edge batches are written as they fill. - Ray runs as a private local cluster with object spilling turned off. It is shut down
after the symbol-table phase.CANPY_RAY_OBJECT_STORE(bytes, default 1 GB) caps the
object store, andCANPY_RAY_CPUScaps the workers.
- The schema's leaf records are slotted stdlib dataclasses, not pydantic models. This
- In-process API: the leaf types above no longer have
.model_dump()or
.model_validate(). Usedataclasses.asdict(...)or the constructor. The
codeanalyzer.schemahelpers (model_dump,model_copy, ...) and the container
models handle them transparently.
Removed
- BREAKING: Python 3.9 and 3.10 are no longer supported; the analyzer needs Python 3.11+
(requires-python = ">=3.11"). The level-4 memory cut (#224) makes the schema's
per-edge and per-statement records slotted stdlib dataclasses. Only pydantic v2 validates
and serializes those the same way as models, and below 3.11 the dependency pins resolved
to pydantic v1 (withray==2.0.0). Thepython_version < '3.11'pin set, thetomli
backport, the pydantic-v1 branches of thecodeanalyzer.schemahelpers, and the 3.10
compatrelease job are gone.codeanalyzer.schema.PYDANTIC_V2stays importable and is
alwaysTrue. Migration: install the analyzer under Python 3.11 or newer.
Metadata
Metadata
Assignees
Labels
No labels
Activity