Skip to content

Commit e3a6c6b

Browse files
authored
Merge pull request #4073 from plotly/deps/plotly-cloud-optional
Move plotly-cloud back to the optional cloud extra
2 parents fd0c8bf + 027796f commit e3a6c6b

5 files changed

Lines changed: 27 additions & 4 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2424
- [#3646](https://github.com/plotly/dash/pull/3646) Remove React 16 support (`16.14.0` is no longer an accepted value for `REACT_VERSION` / `_set_react_version`).
2525

2626
### Changed
27+
- [#4073](https://github.com/plotly/dash/pull/4073) Move `plotly-cloud` back to the optional `dash[cloud]` extra (it was a default dependency in 4.5.0rc0/rc1), since it is not available on conda-forge.
2728
- [#4026](https://github.com/plotly/dash/pull/4026) Log a warning, once per process, when a streaming request is refused because its stream token failed verification, which on multi-worker deployments usually means the workers do not share a signing secret.
2829
- [#3987](https://github.com/plotly/dash/pull/3987) Forward FastAPI reload scope options (`reload_dirs`, `reload_excludes`, and `reload_includes`) to Uvicorn when reloading.
2930
- [#3986](https://github.com/plotly/dash/pull/3986) Adjust `_run_before_hooks` in the `fastapi` backend to honor a response returned by a `before_request` function, matching the `flask` backend's behavior.

‎dash/_plotly_cli.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ def cli():
99
except ImportError:
1010
print(
1111
"Plotly cloud is not installed,"
12-
" install it with `pip install plotly-cloud` (or reinstall dash)"
13-
" to use the plotly command",
12+
" install it with `pip install dash[cloud]` to use the plotly command",
1413
file=sys.stderr,
1514
)
1615
sys.exit(-1)

‎requirements/install.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Flask>=1.0.4,<3.2
22
Werkzeug<3.2
33
plotly>=5.0.0
4-
plotly-cloud
54
importlib-metadata
65
typing_extensions>=4.1.1
76
requests

‎tests/integration/devtools/test_callback_validation.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def check_errors(dash_duo, specs):
3333
found = []
3434
for i in range(cnt):
3535
msg = dash_duo.find_elements(".dash-fe-error__title")[i].text
36-
# plotly-cloud (a default install dep) injects a `_plotly-cloud-*`
36+
# plotly-cloud (installed with dash[cloud]) injects a `_plotly-cloud-*`
3737
# component into every layout via a dash_hooks entry point, so it
3838
# shows up in the "string ids in the current layout" list. Strip it
3939
# so these assertions hold whether or not plotly-cloud is installed.

‎tests/unit/test_plotly_cli.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import sys
2+
from pathlib import Path
3+
4+
import pytest
5+
6+
from dash._plotly_cli import cli
7+
8+
9+
def test_plotly_cli_hints_cloud_extra_when_missing(monkeypatch, capsys):
10+
# A None entry in sys.modules makes the import raise ImportError.
11+
monkeypatch.setitem(sys.modules, "plotly_cloud", None)
12+
monkeypatch.setitem(sys.modules, "plotly_cloud.cli", None)
13+
14+
with pytest.raises(SystemExit) as exc:
15+
cli()
16+
17+
assert exc.value.code == -1
18+
assert "pip install dash[cloud]" in capsys.readouterr().err
19+
20+
21+
def test_plotly_cloud_is_not_an_install_requirement():
22+
install = Path(__file__).parents[2] / "requirements" / "install.txt"
23+
required = install.read_text(encoding="utf-8").lower().split()
24+
assert "plotly-cloud" not in required

0 commit comments

Comments
 (0)