@@ -234,10 +234,12 @@ def run(self):
234
234
235
235
perform_codegen ()
236
236
237
+
237
238
def overwrite_schema_local (uri ):
238
239
path = os .path .join (here , "codegen" , "resources" , "plot-schema.json" )
239
240
shutil .copyfile (uri , path )
240
241
242
+
241
243
def overwrite_schema (url ):
242
244
import requests
243
245
@@ -247,10 +249,12 @@ def overwrite_schema(url):
247
249
with open (path , "wb" ) as f :
248
250
f .write (req .content )
249
251
252
+
250
253
def overwrite_bundle_local (uri ):
251
254
path = os .path .join (here , "plotly" , "package_data" , "plotly.min.js" )
252
255
shutil .copyfile (uri , path )
253
256
257
+
254
258
def overwrite_bundle (url ):
255
259
import requests
256
260
@@ -297,6 +301,7 @@ def request_json(url):
297
301
req = requests .get (url )
298
302
return json .loads (req .content .decode ("utf-8" ))
299
303
304
+
300
305
def get_latest_publish_build_info (repo , branch ):
301
306
302
307
url = (
@@ -318,12 +323,14 @@ def get_latest_publish_build_info(repo, branch):
318
323
# Extract build info
319
324
return {p : build [p ] for p in ["vcs_revision" , "build_num" , "committer_date" ]}
320
325
326
+
321
327
def get_bundle_schema_local (local ):
322
328
plotly_archive = os .path .join (local , "plotly.js.tgz" )
323
329
plotly_bundle = os .path .join (local , "dist/plotly.min.js" )
324
330
plotly_schemas = os .path .join (local , "dist/plot-schema.json" )
325
331
return plotly_archive , plotly_bundle , plotly_schemas
326
332
333
+
327
334
def get_bundle_schema_urls (build_num ):
328
335
url = (
329
336
"https://circleci.com/api/v1.1/project/github/"
@@ -448,7 +455,9 @@ def run(self):
448
455
package_json = json .load (f )
449
456
450
457
# Replace version with bundle url
451
- package_json ["dependencies" ]["plotly.js" ] = archive_url if self .local is None else archive_uri
458
+ package_json ["dependencies" ]["plotly.js" ] = (
459
+ archive_url if self .local is None else archive_uri
460
+ )
452
461
with open (package_json_path , "w" ) as f :
453
462
json .dump (package_json , f , indent = 2 )
454
463
@@ -464,7 +473,7 @@ class UpdatePlotlyJsDevCommand(Command):
464
473
user_options = [
465
474
("devrepo=" , None , "Repository name" ),
466
475
("devbranch=" , None , "branch or pull/number" ),
467
- ("local=" , None , "local copy of repo, used by itself" )
476
+ ("local=" , None , "local copy of repo, used by itself" ),
468
477
]
469
478
470
479
def initialize_options (self ):
0 commit comments