📣 New Release: codeanalyzer-python 1.3.0 #47
rahlk
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
codeanalyzer-python (canpy) v1.3.0
TL;DR — canpy now sees your whole repository, not just the Python in it. Version 1.3.0 adds the artifact layer: every non-code file becomes part of the analysis — dependency manifests parsed into a provenance-tagged SBOM, configuration files parsed into first-class keys, and a new deterministic edge that answers which line of code reads which configuration key. No breaking changes; everything is additive to schema v2.
Highlights
Your repository's files, inventoried.
application.artifactsrecords every non-.pyfile: manifests, Dockerfiles, compose/k8s configs, CI workflows, docs, licenses, scripts — text captured verbatim (size-capped, off-switchable with--no-artifact-text), binaries by hash. Nothing on disk goes unrecorded.Dependencies with evidence.
application.dependenciesparses requirements files (with-r/-cchasing), pyproject (PEP 621 + Poetry), setup.py (statically — never executed), setup.cfg, Pipfile, environment.yml, and the poetry/uv/Pipfile lock files. Every record says where it was declared and how it's known (declared,lockfile, opt-ininstalled-metadata,heuristic); lockfile-only transitives are markeddirect: false. The flip side ships too:application.unresolved_importslists every import no manifest accounts for.Configuration as a graph. Keys from
.env, yaml, json, toml, ini, properties — and now deployment sources: DockerfileENV/ARG, composeenvironment:, k8senv:lists — becomeConfigKeynodes with values, spans, and cross-file references (${VAR},%(name)s,${{ ... }}).Code-to-config edges, never guessed.
PY_USES_CONFIGlinks the exact statement to the exact key it reads, in three deterministic tiers that widen with the analysis level: string literals at-a 2, def-use chains closing on one literal at-a 3, cross-function chains at-a 4. Reads that can't be proven land inapplication.config_reads_unresolvedwith a reason — on odoo, that list is the service's ambient-environment contract (37 env vars the code reads that nothing defines).In Neo4j, the shared nouns are deliberately language-neutral —
:Artifact,:Package(purl ids likepkg:pypi/requests),:ConfigKey— so sibling analyzers over the same repo merge onto the same nodes; the Python-specific claims stayPY_-prefixed.New release assets:
schema.cypher(the Neo4j contract as runnable DDL) and theanalyzing-canpy-graphsskill bundle — a query cookbook covering call-graph, dataflow, taint, SBOM, and the new config analyses.Also in this release: the SDG builder now resolves call sites from the deterministic linker-backed path rather than Jedi's cache-sensitive side channel, and call arguments carry literal values (
PyCallArgument.value/.name).Upgrade
New flags (all optional):
--resolve-installed,--artifact-text/--no-artifact-text,--artifact-text-max-bytes.Links
All reactions