You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Top-level module X.py and package X/ are conflated, producing phantom import cycles #3777
When a project contains both a top-level module X.py and a package directory X/, graphify treats them as the same node. Imports into the package are attributed to the script, which fabricates import cycles that do not exist in the code.
This is a common Python layout — an entry-point script named after the package it launches.
Reproduction
OWASP/Nettacker at current HEAD has exactly this shape:
nettacker.py <- 123-byte entry point script
nettacker/ <- the package
nettacker/logger.py
nettacker/main.py
nettacker/core/app.py
The actual imports are acyclic:
# nettacker.pyfromnettacker.mainimportrun# nettacker/main.pyfromnettacker.core.appimportNettacker# nettacker/core/app.pyfromnettackerimportlogger# -> nettacker/logger.py, i.e. the PACKAGE
from nettacker import logger resolves to nettacker/logger.py. It has nothing to do with the top-level nettacker.py, which never mentions logger at all (grep -c logger nettacker.py → 0).
Actual
GRAPH_REPORT.md reports three cycles, all rooted in the same conflation:
nettacker.py and the package nettacker/ should be distinct nodes. An import of nettacker.<submodule> should resolve to the package, and no cycle should be reported for this project.
Why it matters
"Import Cycles" is presented as a finding worth acting on, and a circular import is normally a genuine design problem — so a false one sends a reader looking for a defect that isn't there. Worse, anything consuming graph.json for reachability inherits the phantom edge silently: the script appears to participate in call paths it has no part in.
Reproduced on a 1,786-node graph of the project above; the same shape will occur in any repo using the foo.py + foo/ entry-point layout.
Environment
graphify 0.9.65 (PyPI graphifyy)
Python 3.14, Windows 10
Command: graphify <path> --code-only then graphify cluster-only <path> --no-label
@safishamsi I'm still pretty new to GitHub, so I'm trying to understand how contribution credit normally works.
Looking back at #3775, I see that I identified the issue, provided the reproduction, and proposed the solution that was ultimately used. I understand that someone else implemented the actual code, and I'm not trying to take credit for writing that code.
What I'm trying to understand is that if someone identifies the problem, investigates it, provides the reproduction, and proposes the solution, how are they normally recognized for that contribution when someone else implements it?
I noticed that the fix was credited to the person who implemented it, but not for the original investigator/solution contributor.
I'm asking because I put a significant amount of time into investigating this issue and arriving at the solution, and I'd like to understand how that contribution is normally recognized on GitHub.
Activity
fix(python): reconcile #3784 phantom-edge retraction with #3729 packa…
safishamsi commentedon Sep 23, 2026
Fixed in v0.9.67 via #3784 — a package/module name collision no longer produces a phantom import cycle. Thanks @hopstreax.
BloodyBeard commentedon Oct 5, 2026
@safishamsi I'm still pretty new to GitHub, so I'm trying to understand how contribution credit normally works.
Looking back at #3775, I see that I identified the issue, provided the reproduction, and proposed the solution that was ultimately used. I understand that someone else implemented the actual code, and I'm not trying to take credit for writing that code.
What I'm trying to understand is that if someone identifies the problem, investigates it, provides the reproduction, and proposes the solution, how are they normally recognized for that contribution when someone else implements it?
I noticed that the fix was credited to the person who implemented it, but not for the original investigator/solution contributor.
I'm asking because I put a significant amount of time into investigating this issue and arriving at the solution, and I'd like to understand how that contribution is normally recognized on GitHub.