plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Declare `kaleido` as an optional dependency

Open tpgillam opened this issue 1 year ago • 2 comments

When calling write_image on a figure, it is required that kaleido is installed in the active environment. It would be great if this dependency were declared in pyproject.toml as an optional group.

For example, here is the approach taken in pyvista:

https://github.com/pyvista/pyvista/blob/e1401a34cbd281bbe74bce8dccbb78b85ab36dc4/pyproject.toml#L40-L59

This would improve ergonomics for packages that depend on plotly, since kaleido is (from their perspective) an implementation detail. Such a package could then depend on plotly[io], for example.

tpgillam avatar Jul 29 '24 09:07 tpgillam

https://github.com/plotly/plotly.py/pull/5062 added plotly[kaleido]

Rupt avatar Jun 03 '25 06:06 Rupt

The version bound on kaleido is pinned to a pre-release: https://github.com/plotly/plotly.py/blob/1d6d3bc99edef16b57c4bfc11c36f11608633f11/pyproject.toml#L49

#5062 declares that both version 0 and version 1 should be supported, so perhaps this pin can be relaxed?

tpgillam avatar Jun 03 '25 08:06 tpgillam

plotly==6.2.0 relaxes the pin to kaleido>=1.0.0 https://github.com/plotly/plotly.py/blob/ae85438086c325a32d91604ae00893f85f125cdc/pyproject.toml#L43

Rupt avatar Jul 03 '25 19:07 Rupt