Bump the version in package.json to new_version Returns True on success, False on failure
(new_version)
| 317 | |
| 318 | |
| 319 | def 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 | |
| 348 | def bump_version_citation_cff(new_version, new_date): |