Skip to content

Commit 0db8555

Browse files
committed
fix: minor updates based on feedback from @emilykl
1 parent 12cd7a6 commit 0db8555

File tree

6 files changed

+22
-12
lines changed

6 files changed

+22
-12
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ commands:
2525
curl -LsSf https://astral.sh/uv/install.sh | sh
2626
uv venv
2727
source .venv/bin/activate
28+
uv lock --check
2829
uv sync --extra dev_core
2930
- run:
3031
name: List installed packages and python version
@@ -122,7 +123,7 @@ commands:
122123
curl -LsSf https://astral.sh/uv/install.sh | sh
123124
uv venv
124125
source .venv/bin/activate
125-
uv pip install .[dev_optional]
126+
uv sync --extra dev_optional
126127
# Install Kaleido v0 instead of the v1 specified in requirements_optional.txt
127128
uv pip uninstall kaleido
128129
uv pip install kaleido==0.2.1

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ If you are using `uv`,
109109
you can install all of the packages needed for developing and testing plotly.py with this command:
110110

111111
```bash
112-
uv pip install -e '.[dev]'
112+
uv sync --extra dev
113113
```
114114

115-
If you are using `conda` or `virtualenv`, you can install all packages with:
115+
If you are using `conda` or `virtualenv`,
116+
or if `uv sync` does not work as you expect,
117+
you can install all packages with:
116118

117119
```bash
118120
pip install -e '.[dev]'
@@ -150,6 +152,11 @@ Once you have made your changes and tested them,
150152
push your changes to your fork of the plotly.py repository on GitHub
151153
and create your pull request.
152154

155+
> **Managing `uv.lock`**
156+
>
157+
> Please do _not_ commit changes to `uv.lock`
158+
> unless you have added, removed, or changed dependencies in `pyproject.toml`.
159+
153160
### Testing
154161

155162
We use [pytest](https://docs.pytest.org/) for managing and running tests.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ dependencies = [
4242
express = ["numpy"]
4343
kaleido = ["kaleido==1.0.0rc15"]
4444
dev_core = [
45-
"anywidget",
4645
"pytest",
4746
"requests",
4847
# pin precise version of ruff to prevent accidental reformatting in case its defaults are updated
@@ -56,6 +55,7 @@ dev_build = [
5655
dev_optional = [
5756
"plotly[dev_build]",
5857
"plotly[kaleido]",
58+
"anywidget",
5959
"colorcet",
6060
# fiona>1.9.6 is not compatible with geopandas<1; geopandas>=1 is not compatible with python 3.8
6161
"fiona<=1.9.6;python_version<='3.8'",
@@ -101,6 +101,7 @@ plotly = [
101101
"package_data/*",
102102
"package_data/templates/*",
103103
"package_data/datasets/*",
104+
"validators/_validators.json"
104105
]
105106

106107
[tool.jupyter-packaging.builder]

tests/test_core/test_figure_widget_backend/test_missing_anywidget.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# ruff: noqa: F401 F403 F405
2+
13
import pytest
24

35
# Use wildcard import to make sure FigureWidget is always included
4-
from plotly.graph_objects import FigureWidget
6+
from plotly.graph_objects import *
7+
from plotly.missing_anywidget import FigureWidget as FigureWidgetMissingAnywidget
58

69
try:
7-
from plotly.missing_anywidget import FigureWidget as FigureWidgetMissingAnywidget
10+
import anywidget as _anywidget
811

912
missing_anywidget = False
1013
except Exception:

tests/test_io/test_html.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ def test_cdn_integrity_hash_matches_bundled_content(fig1):
6868
expected_hash = _generate_sri_hash(plotlyjs_content)
6969

7070
# Verify they match
71-
assert (
72-
extracted_hash == expected_hash
73-
), f"Hash mismatch: expected {expected_hash}, got {extracted_hash}"
71+
assert extracted_hash == expected_hash, (
72+
f"Hash mismatch: expected {expected_hash}, got {extracted_hash}"
73+
)

uv.lock

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)