Skip to content

Commit a537e41

Browse files
committed
Add plotly-cloud as optional dependency and mock the cli if not installed
1 parent 4b8917e commit a537e41

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

dash/_plotly_cli.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import sys
2+
3+
4+
def cli():
5+
try:
6+
from plotly_cloud.cli import main # pylint: disable=import-outside-toplevel
7+
8+
main()
9+
except ImportError:
10+
print(
11+
"Plotly cloud is not installed,"
12+
" install it with `pip install dash[cloud]` to use the plotly command",
13+
file=sys.stderr,
14+
)
15+
sys.exit(-1)

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ def read_req_file(req_type):
3535
"testing": read_req_file("testing"),
3636
"celery": read_req_file("celery"),
3737
"diskcache": read_req_file("diskcache"),
38-
"compress": read_req_file("compress")
38+
"compress": read_req_file("compress"),
39+
"cloud": read_req_file("cloud"),
3940
},
4041
entry_points={
4142
"console_scripts": [
4243
"dash-generate-components = "
4344
"dash.development.component_generator:cli",
4445
"renderer = dash.development.build_process:renderer",
4546
"dash-update-components = dash.development.update_components:cli"
47+
"plotly = dash._plotly_cli:cli"
4648
],
4749
"pytest11": ["dash = dash.testing.plugin"],
4850
},

0 commit comments

Comments
 (0)