Skip to content

Incorporate codeanalyzer-python v0.3.1 #259

Description

@rahlk

A new codeanalyzer-python release (v0.3.1) is published.
Update the codeanalyzer-python pin in this repo and adapt the
integration to the changes below (see PyCodeanalyzer._run_analyzer).

[0.3.1] - 2026-07-14

Added

  • Class-attribute initializersPyClassAttribute.initializer captures the assignment RHS (_name = 'account.account' is now recoverable), projected as PyAttribute.initializer (#83).
  • Structured call-site argumentsPyCallsite.arguments: [{ast_kind, inferred_type?}] separates the AST category from the Jedi-inferred type (absent when unknown), projected as PyCallSite.arguments_json (#86).
  • Snapshot provenancePyApplication.repository {uri, revision, dirty} (git queried read-only at analysis time; absent for non-checkouts) and PyApplication.analyzer {name, version, config}, mirrored as flattened :PyApplication properties (#85).
  • Internal import resolution — each PyImport gains resolved_module (the analyzed target module's file key); resolved imports project as PY_IMPORTS edges to the real :PyModule (one edge per module pair, raw spellings preserved in a spellings array), externals keep :PyPackage, and unresolved relative spellings (., .foo, ..x) no longer mint bogus :PyPackage nodes (#82).
  • Neo4j SCHEMA_VERSION bumped 1.1.0 → 1.2.0 (additive: new properties on PyAttribute, PyCallSite, PyApplication, PY_IMPORTS; PY_IMPORTS may now target :PyModule).

Deprecated

  • PyCallsite.argument_types (and the PyCallSite.argument_types graph property): it silently mixes AST node categories with inferred type names in one list. Use arguments/arguments_json instead; the legacy field is unchanged and will be removed in schema v2 (#86).

Fixed

  • Attribute-call callees (receiver.method(...)) now resolve to the invoked method instead of the receiver's type — Jedi inference was anchored at the call expression's first character, i.e. the receiver token, so nearly every method call's callee_signature (and the Neo4j PY_RESOLVES_TO edge) pointed at the receiver's class (#80).
  • PyCallsite.return_type now holds the inferred type of the call result (the callee's inferred return type, or the instance for a constructor call), and is absent when Jedi cannot tell. Previously it held the type inferred at the call expression's start — effectively the receiver's type (#80).
  • SymbolTableBuilder no longer crashes with ValueError when given a relative project_dir: the path is normalized with os.path.abspath at construction (symlinks intact, matching Jedi's own path normalization) (#90).
  • Path-derived fallback signatures no longer corrupt module prefixes containing .py as a substring (odoo/tools/pycompat.pyodoo.toolscompat): only the terminal .py suffix is stripped, via a single _fallback_signature helper replacing three copies of the buggy expression (#84).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions