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

Function bump_version_package_json

commands.py:319–345  ·  view source on GitHub ↗

Bump the version in package.json to new_version Returns True on success, False on failure

(new_version)

Source from the content-addressed store, hash-verified

317
318
319def bump_version_package_json(new_version):
320 """
321 Bump the version in package.json to new_version
322 Returns True on success, False on failure
323 """
324 js_dir = "js"
325 subprocess.run(
326 ["npm", "version", new_version, "--no-git-tag-version", "--allow-same-version"],
327 cwd=js_dir,
328 check=True,
329 )
330 print(
331 f"SUCCESS: Updated version in {js_dir}/package.json and {js_dir}/package-lock.json to {new_version}"
332 )
333
334 # After modifying files in js/, we need to rebuild the JupyterLab extension
335 print("Rebuilding JupyterLab extension (this may take a few seconds)...")
336 subprocess.run(
337 ["npm", "run", "build:labextension"],
338 cwd=js_dir,
339 check=True,
340 stdout=subprocess.DEVNULL, # Suppress stdout and stderr to avoid terminal clutter
341 stderr=subprocess.DEVNULL,
342 )
343 print(f"SUCCESS: Updated JupyterLab extension files in plotly/labextension")
344
345 return True
346
347
348def bump_version_citation_cff(new_version, new_date):

Callers 1

bump_versionFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected