Make anywidget an optional dependency?

Open
#558 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
44/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
build-system

Research direction

Start in pyproject.toml at the dependency list and locate the anywidget entry, then grep the package for anywidget imports to see which module owns the notebook widget path. Confirm the static PNG/SVG rendering path never imports it, so an install without the extra still exports images. Done means anywidget moves to an optional extras group, the widget import fails with a clear message when absent, and the test suite passes both with and without the extra installed. Note the issue asks a design question, so a maintainer's answer on the intended policy comes first.

Written by the indexing model from the issue text.

Description

Thanks for creating XY I was looking for a lightweight alternative to Matplotlib for generating static plots, and XY caught my attention.

Currently, anywidget is listed as a mandatory dependency in pyproject.toml.

However, it seems to be primarily used for interactive notebook display, while static exports such as PNG and SVG use separate rendering paths.

For users who only use XY for static image generation (e.g. in batch processing or server-side scripts), installing anywidget and its dependencies seems unnecessary.

Would it be possible to make anywidget an optional dependency, required only when using the notebook widget functionality?

Or is there a reason why it needs to be a mandatory dependency?

Dominant language
Python
Stars
1.9k
Forks
81
Avg merge
7h 57m
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reflex-dev/xy

All issues in reflex-dev/xy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.