Skip to content

Commit 4ddcd8b

Browse files
authored
Merge branch 'main' into migrate-ci-to-gh-actions
2 parents 15a5029 + 54e2f84 commit 4ddcd8b

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

RELEASE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ a link to the plotly.js CHANGELOG.
3030
- `uv.lock`
3131
- `js/package.json`
3232
- `js/package-lock.json`
33+
- `plotly/labextension/*`
3334
- `CHANGELOG.md` (Adds a new header for X.Y.Z above the unreleased items)
3435
- `CITATION.cff`
3536

3637
- Run `git diff` and ensure the above files were all updated correctly.
3738
- Note: The current date is used as the release date in `CHANGELOG.md` and `CITATION.cff`. If you want to use a different date, edit these files manually afterward.
3839
- If the bumpversion command failed for any reason, you can update the versions yourself by doing the following:
3940
- Manually update the version number (and release date, as needed) in `pyproject.toml`, `CHANGELOG.md` and `CITATION.cff`
40-
- Run `npm version X.Y.Z` to update `js/package.json` and `js/package-lock.json`
4141
- Run `uv lock` to update `uv.lock`
42+
- From the `js/` dir, run `npm version X.Y.Z` to update `js/package.json` and `js/package-lock.json`
43+
- From the `js/` dir, run `npm run build:labextension` to regenerate the files in `plotly/labextension/`
4244

4345
- Commit and push the changed files to the release branch:
4446
```sh

commands.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def bump_version_pyproject_toml(new_version):
328328
subprocess.run(["uv", "lock"], check=True)
329329

330330
print(
331-
f"Updated version in {pyproject_toml_path} to {new_version},",
331+
f"SUCCESS: Updated version in {pyproject_toml_path} to {new_version},",
332332
"and updated uv lockfile",
333333
)
334334
return True
@@ -346,8 +346,20 @@ def bump_version_package_json(new_version):
346346
check=True,
347347
)
348348
print(
349-
f"Updated version in {js_dir}/package.json and {js_dir}/package-lock.json to {new_version}"
349+
f"SUCCESS: Updated version in {js_dir}/package.json and {js_dir}/package-lock.json to {new_version}"
350350
)
351+
352+
# After modifying files in js/, we need to rebuild the JupyterLab extension
353+
print("Rebuilding JupyterLab extension (this may take a few seconds)...")
354+
subprocess.run(
355+
["npm", "run", "build:labextension"],
356+
cwd=js_dir,
357+
check=True,
358+
stdout=subprocess.DEVNULL, # Suppress stdout and stderr to avoid terminal clutter
359+
stderr=subprocess.DEVNULL,
360+
)
361+
print(f"SUCCESS: Updated JupyterLab extension files in plotly/labextension")
362+
351363
return True
352364

353365

@@ -392,7 +404,7 @@ def bump_version_citation_cff(new_version, new_date):
392404
with open(citation_cff_path, "w") as f:
393405
f.write(new_content)
394406
print(
395-
f"Updated version in {citation_cff_path} to {new_version}",
407+
f"SUCCESS: Updated version in {citation_cff_path} to {new_version}",
396408
f"and date-released to {new_date}",
397409
)
398410
return True
@@ -414,7 +426,7 @@ def bump_version_changelog_md(new_version, new_date):
414426
already_exists_pattern = rf"(^\s*##\s*\[ *{re.escape(new_version)} *\])"
415427
if re.search(already_exists_pattern, content, flags=re.MULTILINE):
416428
print(
417-
f"Header for version {new_version} already exists ",
429+
f"Header for version {new_version} already exists",
418430
f"in {changelog_md_path}.",
419431
)
420432
return True

0 commit comments

Comments
 (0)