Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 28a02a1

Browse filesBrowse files
committed
updated version checker with pip
1 parent bb7c7e3 commit 28a02a1
Copy full SHA for 28a02a1

File tree

Expand file treeCollapse file tree

3 files changed

+9
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-6
lines changed

‎plotly/__init__.py

Copy file name to clipboardExpand all lines: plotly/__init__.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@
3939
print("Your version of Plotly is currently outdated,\n" +
4040
"You're currently running {old}".format(old=__version__) +
4141
", while the latest version is {}".format(_latest))
42+
else:
43+
print("Plotly is currently up to date.\n" +
44+
"Plotly version: {}".format(__version__))

‎plotly/check_version.py

Copy file name to clipboardExpand all lines: plotly/check_version.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import urllib2 # the lib that handles the url stuff
1+
import os
22
import re
33

4-
54
def get_latest():
6-
data = urllib2.urlopen('https://raw.githubusercontent.com/plotly/plotly.py/master/plotly/version.py') # it's a file like object and works just like a file
7-
version_string = [i for i in data][0]
8-
latest_version = re.findall(r'\'.*\'', version_string)[0][1:-1]
5+
os.system('pip show plotly > pip_version.txt')
6+
with open('pip_version.txt', 'r') as file:
7+
output = [i for i in file][2]
8+
latest_version = re.findall(r'\s.*\n', output)[0][1:-1]
99
return latest_version
1010

1111
def run_duration(f, **kwargs):

‎plotly/version.py

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

33

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.