MCPcopy Index your code
hub / github.com/plotly/plotly.py / update_schema_bundle_from_master

Function update_schema_bundle_from_master

commands.py:231–273  ·  view source on GitHub ↗

Update the plotly.js schema and bundle from master.

(args)

Source from the content-addressed store, hash-verified

229
230# FIXME: switch to argparse
231def update_schema_bundle_from_master(args):
232 """Update the plotly.js schema and bundle from master."""
233 if args.local is None:
234 build_info = get_latest_commit_info(args.devrepo, args.devbranch)
235 archive_url, bundle_url, schema_url = get_github_urls(
236 args.devrepo, build_info["vcs_revision"]
237 )
238
239 # Update bundle in package data
240 overwrite_bundle(bundle_url)
241
242 # Update schema in package data
243 overwrite_schema(schema_url)
244 else:
245 # this info could be more informative but it doesn't seem as
246 # useful in a local context and requires dependencies and
247 # programming.
248 build_info = {"vcs_revision": "local", "committer_date": str(time.time())}
249 args.devrepo = args.local
250 args.devbranch = ""
251
252 archive_uri, bundle_uri, schema_uri = get_bundle_schema_local(args.local)
253 overwrite_bundle_local(bundle_uri)
254 overwrite_schema_local(schema_uri)
255
256 # Update plotly.js url in package.json
257 package_json_path = os.path.join(NODE_ROOT, "package.json")
258 with open(package_json_path, "r") as f:
259 package_json = json.load(f)
260
261 # Replace version with bundle url
262 package_json["dependencies"]["plotly.js"] = (
263 archive_url if args.local is None else archive_uri
264 )
265 with open(package_json_path, "w") as f:
266 json.dump(package_json, f, indent=2)
267
268 # update plotly.js version in _plotlyjs_version
269 rev = build_info["vcs_revision"]
270 date = str(build_info["committer_date"])
271 version = "_".join([args.devrepo, args.devbranch, date[:10], rev[:8]])
272 overwrite_plotlyjs_version_file(version)
273 install_js_deps(args.local)
274
275
276def update_plotlyjs_dev(args, outdir):

Callers 1

update_plotlyjs_devFunction · 0.85

Calls 10

get_latest_commit_infoFunction · 0.85
get_github_urlsFunction · 0.85
overwrite_bundleFunction · 0.85
overwrite_schemaFunction · 0.85
get_bundle_schema_localFunction · 0.85
overwrite_bundle_localFunction · 0.85
overwrite_schema_localFunction · 0.85
install_js_depsFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected