@@ -47,7 +47,6 @@ def install_js_deps(local):
47
47
except :
48
48
has_npm = False
49
49
50
-
51
50
skip_npm = os .environ .get ("SKIP_NPM" , False )
52
51
if skip_npm :
53
52
log .info ("Skipping npm-installation" )
@@ -62,9 +61,7 @@ def install_js_deps(local):
62
61
env ["PATH" ] = npm_path
63
62
64
63
if has_npm :
65
- log .info (
66
- "Installing build dependencies with npm. This may take a while..."
67
- )
64
+ log .info ("Installing build dependencies with npm. This may take a while..." )
68
65
check_call (
69
66
[npmName , "install" ],
70
67
cwd = node_root ,
@@ -92,6 +89,7 @@ def install_js_deps(local):
92
89
msg = "Missing file: %s" % t
93
90
raise ValueError (msg )
94
91
92
+
95
93
# Generate class hierarchy from Plotly JSON schema
96
94
def run_codegen ():
97
95
if sys .version_info < (3 , 8 ):
@@ -126,7 +124,7 @@ def overwrite_bundle(url):
126
124
import requests
127
125
128
126
req = requests .get (url )
129
- print (' url:' , url )
127
+ print (" url:" , url )
130
128
assert req .status_code == 200
131
129
path = os .path .join (here , "plotly" , "package_data" , "plotly.min.js" )
132
130
with open (path , "wb" ) as f :
@@ -146,6 +144,7 @@ def overwrite_plotlyjs_version_file(plotlyjs_version):
146
144
)
147
145
)
148
146
147
+
149
148
def request_json (url ):
150
149
import requests
151
150
@@ -212,6 +211,7 @@ def update_schema(plotly_js_version):
212
211
)
213
212
overwrite_schema (url )
214
213
214
+
215
215
# Download latest version of the plotly.js bundle
216
216
def update_bundle (plotly_js_version ):
217
217
url = (
@@ -224,12 +224,14 @@ def update_bundle(plotly_js_version):
224
224
plotlyjs_version = plotly_js_version
225
225
overwrite_plotlyjs_version_file (plotlyjs_version )
226
226
227
+
227
228
# Update project to a new version of plotly.js
228
229
def update_plotlyjs (plotly_js_version ):
229
230
update_bundle (plotly_js_version )
230
231
update_schema (plotly_js_version )
231
232
run_codegen ()
232
-
233
+
234
+
233
235
# Update the plotly.js schema and bundle from master
234
236
def update_schema_bundle_from_master ():
235
237
@@ -291,14 +293,15 @@ def update_schema_bundle_from_master():
291
293
overwrite_plotlyjs_version_file (version )
292
294
install_js_deps (local )
293
295
296
+
294
297
# Update project to a new development version of plotly.js
295
298
def update_plotlyjs_dev ():
296
299
update_schema_bundle_from_master ()
297
300
run_codegen ()
298
301
302
+
299
303
if "updateplotlyjsdev" in sys .argv :
300
304
update_plotlyjs_dev ()
301
305
elif "updateplotlyjs" in sys .argv :
302
306
print (plotly_js_version ())
303
307
update_plotlyjs (plotly_js_version ())
304
-
0 commit comments