Skip to content

FP: SKY-CIRC on top level package #789

Description

@mcdigman

What was flagged?

The module's own name is flagged as a circular import, which it is not. This finding does not affect the scores and my skylos CI does not fail even with --strict, so it is merely a cosmetic false positive.

Also I am not sure if this is intended behavior, but this finding only appears in the rich formatted output, not --format concise or --format pretty.

─────────────────────────────────────────────────────────────────────────────────────── Circular Dependencies ───────────────────────────────────────────────────────────────────────────────────────
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ #               ┃ Cycle                                                        ┃ Length                   ┃ Severity                       ┃ Suggested Break                                      ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1               │ pyakima → pyakima                                            │ 1                        │ LOW                            │ pyakima                                              │
└─────────────────┴──────────────────────────────────────────────────────────────┴──────────────────────────┴────────────────────────────────┴──────────────────────────────────────────────────────┘
Cycle — the chain of modules that import each other in a loop.
Length — how many modules are in the cycle.

Why is it a false positive?
This is a self-loop of length 1, not a real cycle. The cause is node granularity in the analyzer: the importer keeps its full dotted module name, but the import target is collapsed to its top-level package with _module_root(). So pyakima/init.py — whose module name is pyakima — importing pyakima.pyakima and pyakima._version becomes the edge pyakima → pyakima.

Skylos version
skylos 4.35.0

Minimal reproduction
Attached

skylos_circ_package_init_reexport.zip

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions