Skip to content

Commit f5f7724

Browse files
committed
Replaced retrying depedency in chart-studio with tenacity. Updated create_conda_optional_env.sh to reflect change in dependencies. Reformated _orca.py with black.
1 parent 7648b1a commit f5f7724

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

Diff for: .circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ jobs:
327327
- checkout
328328
- run:
329329
name: Install tox
330-
command: "sudo pip install retrying tox black inflect"
330+
command: "sudo pip install tenacity tox black inflect"
331331
- run:
332332
name: Update jupyterlab-plotly version
333333
command: "cd packages/python/plotly; python setup.py updateplotlywidgetversion"

Diff for: .circleci/create_conda_optional_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
1616
# Create environment
1717
# PYTHON_VERSION=2.7 or 3.5
1818
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
19-
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels
19+
requests nbformat six tenacity psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels
2020

2121
# Install orca into environment
2222
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca==1.3.1

Diff for: packages/python/chart-studio/chart_studio/api/v2/utils.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44
import json as _json
55
from requests.exceptions import RequestException
6-
from retrying import retry
6+
import tenacity
77

88
import _plotly_utils.exceptions
99
from chart_studio import config, exceptions
@@ -129,11 +129,10 @@ def should_retry(exception):
129129
return False
130130

131131

132-
@retry(
133-
wait_exponential_multiplier=1000,
134-
wait_exponential_max=16000,
135-
stop_max_delay=180000,
136-
retry_on_exception=should_retry,
132+
@tenacity.retry(
133+
wait=tenacity.wait.wait_exponential(multiplier=1000, max=16000),
134+
stop=tenacity.stop.stop_after_delay(180000),
135+
retry=tenacity.retry.retry_if_exception(should_retry),
137136
)
138137
def request(method, url, **kwargs):
139138
"""

Diff for: packages/python/chart-studio/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ def readme():
4141
"chart_studio.plotly.chunked_requests",
4242
"chart_studio.presentation_objs",
4343
],
44-
install_requires=["plotly", "requests", "retrying>=1.3.3", "six"],
44+
install_requires=["plotly", "requests", "tenacity>=6.2.0", "six"],
4545
zip_safe=False,
4646
)

Diff for: packages/python/chart-studio/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ deps=
5656
requests==2.12.4
5757
six==1.10.0
5858
pytz==2016.10
59-
retrying==1.3.3
59+
tenacity==6.2.0
6060
pytest==3.5.1
6161
backports.tempfile==1.0
6262
pandas==0.23.2

Diff for: packages/python/plotly/plotly/io/_orca.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,10 @@ def ensure_server():
14511451
orca_state["shutdown_timer"] = t
14521452

14531453

1454-
@tenacity.retry(wait=tenacity.wait.wait_random(min=5, max=10), stop=tenacity.stop.stop_after_delay(60000))
1454+
@tenacity.retry(
1455+
wait=tenacity.wait.wait_random(min=5, max=10),
1456+
stop=tenacity.stop.stop_after_delay(60000),
1457+
)
14551458
def request_image_with_retrying(**kwargs):
14561459
"""
14571460
Helper method to perform an image request to a running orca server process

Diff for: packages/python/plotly/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ deps=
5555
requests==2.12.4
5656
six==1.10.0
5757
pytz==2016.10
58-
retrying==1.3.3
58+
tenacity==6.2.0
5959
pytest==3.5.1
6060
pandas==0.24.2
6161
xarray==0.10.9

0 commit comments

Comments
 (0)