@@ -47,7 +47,6 @@ def install_js_deps(local):
4747 except :
4848 has_npm = False
4949
50-
5150 skip_npm = os .environ .get ("SKIP_NPM" , False )
5251 if skip_npm :
5352 log .info ("Skipping npm-installation" )
@@ -62,9 +61,7 @@ def install_js_deps(local):
6261 env ["PATH" ] = npm_path
6362
6463 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..." )
6865 check_call (
6966 [npmName , "install" ],
7067 cwd = node_root ,
@@ -92,6 +89,7 @@ def install_js_deps(local):
9289 msg = "Missing file: %s" % t
9390 raise ValueError (msg )
9491
92+
9593# Generate class hierarchy from Plotly JSON schema
9694def run_codegen ():
9795 if sys .version_info < (3 , 8 ):
@@ -126,7 +124,7 @@ def overwrite_bundle(url):
126124 import requests
127125
128126 req = requests .get (url )
129- print (' url:' , url )
127+ print (" url:" , url )
130128 assert req .status_code == 200
131129 path = os .path .join (here , "plotly" , "package_data" , "plotly.min.js" )
132130 with open (path , "wb" ) as f :
@@ -146,6 +144,7 @@ def overwrite_plotlyjs_version_file(plotlyjs_version):
146144 )
147145 )
148146
147+
149148def request_json (url ):
150149 import requests
151150
@@ -212,6 +211,7 @@ def update_schema(plotly_js_version):
212211 )
213212 overwrite_schema (url )
214213
214+
215215# Download latest version of the plotly.js bundle
216216def update_bundle (plotly_js_version ):
217217 url = (
@@ -224,12 +224,14 @@ def update_bundle(plotly_js_version):
224224 plotlyjs_version = plotly_js_version
225225 overwrite_plotlyjs_version_file (plotlyjs_version )
226226
227+
227228# Update project to a new version of plotly.js
228229def update_plotlyjs (plotly_js_version ):
229230 update_bundle (plotly_js_version )
230231 update_schema (plotly_js_version )
231232 run_codegen ()
232-
233+
234+
233235# Update the plotly.js schema and bundle from master
234236def update_schema_bundle_from_master ():
235237
@@ -291,14 +293,15 @@ def update_schema_bundle_from_master():
291293 overwrite_plotlyjs_version_file (version )
292294 install_js_deps (local )
293295
296+
294297# Update project to a new development version of plotly.js
295298def update_plotlyjs_dev ():
296299 update_schema_bundle_from_master ()
297300 run_codegen ()
298301
302+
299303if "updateplotlyjsdev" in sys .argv :
300304 update_plotlyjs_dev ()
301305elif "updateplotlyjs" in sys .argv :
302306 print (plotly_js_version ())
303307 update_plotlyjs (plotly_js_version ())
304-
0 commit comments