Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced 'retrying' dependency with 'tenacity' in plotly package #2911

Merged
merged 10 commits into from
Apr 22, 2021
Merged
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
- checkout
- run:
name: Install tox
command: "sudo pip install retrying tox black inflect"
command: "sudo pip install tenacity tox black inflect"
- run:
name: Update jupyterlab-plotly version
command: "cd packages/python/plotly; python setup.py updateplotlywidgetversion"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/create_conda_optional_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
# Create environment
# PYTHON_VERSION=2.7 or 3.5
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels
requests nbformat six retrying tenacity psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets statsmodels

# Install orca into environment
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca==1.3.1
Expand Down
12 changes: 7 additions & 5 deletions packages/python/plotly/plotly/io/_orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from copy import copy
from contextlib import contextmanager

import retrying
import tenacity
from six import string_types

import _plotly_utils.utils
Expand Down Expand Up @@ -1173,11 +1173,11 @@ def validate_executable():

>>> import plotly.io as pio
>>> pio.orca.config.use_xvfb = True

You can save this configuration for use in future sessions as follows:

>>> pio.orca.config.save()
>>> pio.orca.config.save()

See https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml
for more info on Xvfb
"""
Expand Down Expand Up @@ -1451,7 +1451,9 @@ def ensure_server():
orca_state["shutdown_timer"] = t


@retrying.retry(wait_random_min=5, wait_random_max=10, stop_max_delay=60000)
@tenacity.retry(
wait=tenacity.wait_random(min=5, max=10), stop=tenacity.stop_after_delay(60000),
)
def request_image_with_retrying(**kwargs):
"""
Helper method to perform an image request to a running orca server process
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
- setuptools
run:
- python
- retrying >=1.3.3
- tenacity >=6.2.0
- six

test:
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###################################################

## python 2 to 3 compatibility ##
six==1.8.0
six==1.15.0

## retrying requests ##
retrying==1.3.3
tenacity>=6.2.0
2 changes: 1 addition & 1 deletion packages/python/plotly/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def run(self):
),
("etc/jupyter/nbconfig/notebook.d", ["plotlywidget.json"]),
],
install_requires=["retrying>=1.3.3", "six"],
install_requires=["tenacity>=6.2.0", "six"],
zip_safe=False,
cmdclass=dict(
build_py=js_prerelease(versioneer_cmds["build_py"]),
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ deps=
requests==2.12.4
six==1.10.0
pytz==2016.10
retrying==1.3.3
tenacity==6.2.0
pytest==3.5.1
pandas==0.24.2
xarray==0.10.9
Expand Down