Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91e3f59

Browse files
committed
added new method to get latest version with pip
1 parent 28a02a1 commit 91e3f59

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

plotly/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from plotly import (plotly, graph_objs, grid_objs, tools, utils, session,
3232
offline)
3333
from plotly.version import __version__
34-
from plotly.check_version import get_latest
34+
from plotly.check_version_sp import get_latest
3535

3636
_latest = get_latest()
3737

@@ -42,3 +42,4 @@
4242
else:
4343
print("Plotly is currently up to date.\n" +
4444
"Plotly version: {}".format(__version__))
45+

plotly/check_version_sp.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import subprocess
2+
3+
def get_latest():
4+
latest_version = subprocess.check_output(['pip', 'show', 'plotly']).split('\n')[2][9:]
5+
return latest_version
6+
7+
def run_duration(f, **kwargs):
8+
import timeit
9+
start_time = timeit.default_timer()
10+
f(**kwargs)
11+
return (timeit.default_timer() - start_time)
12+
13+
14+
15+
16+
17+
18+

plotly/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '1.9.6'
1+
__version__ = '1.9.7'
22

33

0 commit comments

Comments
 (0)