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

include nbformat as a plotly[express] dependency

Open afeld opened this issue 3 months ago • 3 comments

Required for MimeType rendering. Closes https://github.com/plotly/plotly.py/issues/4512.

Code PR

  • [x] I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the code generator and not the generated files.
  • [ ] ~~I have added tests or modified existing tests.~~
  • [ ] ~~For a new feature, I have added documentation examples (please see the doc checklist as well).~~
  • [x] I have added a CHANGELOG entry if changing anything substantial.
  • [ ] ~~For a new feature or a change in behavior, I have updated the relevant docstrings in the code.~~

afeld avatar Oct 16 '25 21:10 afeld

Hmm, the remaining build error doesn't sense to me… Doesn't seem to be happening on main, but at a glance, I don't get why this change would have caused it. Any suggestions?

afeld avatar Oct 28 '25 13:10 afeld

@afeld AFAIK nbformat is only required when working with Jupyter notebooks, is there a scenario you've encountered where you require nbformat when working outside Jupyter?

In general we try to keep Plotly Express dependencies pretty minimal and only require packages which are needed in all scenarios.

Would be open to maybe adding a [jupyter] extra or something along those lines though.

emilykl avatar Nov 17 '25 20:11 emilykl

nbformat is only required when working with Jupyter notebooks …

Sure. Do you have a sense of how many Plotly Express users are doing so in Jupyter vs. not?

is there a scenario you've encountered where you require nbformat when working outside Jupyter?

No, I exclusively(?) use Plotly with Jupyter, with build tools like nbconvert and Jupyter Book.

In general we try to keep Plotly Express dependencies pretty minimal and only require packages which are needed in all scenarios.

The impression I got was that plotly contains the bare minimum, while plotly[express] was the "batteries included" / "give me what I need to make charts quickly" option. (Re-reading the Getting Started, realizing that is not what it says.)

Would be open to maybe adding a [jupyter] extra or something along those lines though.

That makes sense to me!

pip install plotly[express,jupyter]

would still be easy for users. I'll update.

afeld avatar Nov 18 '25 16:11 afeld