Skip to content

Incremental update drops Python imports and calls that go through an unchanged package __init__.py #5676

Backlog

Description

@Max17190

On v8 at d249de36 (0.9.124), an incremental rebuild drops every import and call that the edited Python file makes through an unchanged package __init__.py. This happens with graphify update, the watcher and the git hooks, and the edges come back only after a full rebuild. On django, adding a comment to tests/admin_views/tests.py loses 690 of the file's 1121 import and call edges.

Python re-export facts come only from an __init__.py that is in the parsed batch. #5595 gave JS/TS barrels export facts from unchanged files, but Python has no equivalent. So from lib import f stops at lib/__init__.py and never reaches lib/a.py. Related: #2406 and #3570.

Reproduction
mkdir -p p/lib && cd p
printf 'def f():\n    return 1\n' > lib/a.py
printf 'from .a import f\n' > lib/__init__.py
printf 'from lib import f\n\n\ndef main():\n    return f()\n' > app.py
graphify update .
echo '# edited' >> app.py
graphify update .

A full build has app imports lib_a_f and app_main calls lib_a_f. After the incremental update only lib_init imports lib_a_f remains.

Linux, CPython 3.12.3.

Activity

  1. github-actions commented on Dec 1, 2026

    @github-actions

    Thanks for opening this issue, @Max17190. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions