Skip to content

The plot extra declares matplotlib and plotly, but nothing imports them #369

Closed

Description

@CameronBrooks11

pyproject.toml:42 declares:

plot = ["matplotlib>=3.8", "plotly>=5.22"]

Neither package is imported anywhere in the codebase. fiberpath plot is implemented in fiberpath_cli/plot.py → fiberpath/visualization/plotter.py, which renders with Pillow (from PIL import Image, ImageDraw).

Evidence

$ git grep -nIE 'plotly|matplotlib|pyplot' -- . ':!uv.lock' ':!fiberpath_gui/package-lock.json'
pyproject.toml:42:plot = ["matplotlib>=3.8", "plotly>=5.22"]

That is the only hit in tracked source. There are also no dynamic imports anywhere to hide a lazy use — git grep -nIE "import_module\(|__import__\(" returns nothing.

Why it matters beyond tidiness

dependency-audit.yml:34 runs uv export --all-extras, so the plot extra is inside the audited dependency set. Two unused packages (and their transitive trees) therefore contribute advisories that can turn the Dependency Audit red on main — the exact failure mode that was red earlier today for an unrelated reason.

It is also live churn: today's lock-file-maintenance PR (#363) carries plotly 6.9.0 → 7.0.0, a major bump of a package the project does not use.

Suggested fix

Drop the plot extra, or reduce it to what is actually used. Worth confirming first that no downstream consumer installs fiberpath[plot] expecting those to be present.

Found while reviewing #361/#363 before merge.

Activity

  1. added
    enhancement
    dependencies
    python
    on Sep 8, 2026
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

    dependenciesenhancementpython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions