Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ a link to the plotly.js CHANGELOG.
- `uv.lock`
- `js/package.json`
- `js/package-lock.json`
- `plotly/labextension/*`
- `CHANGELOG.md` (Adds a new header for X.Y.Z above the unreleased items)
- `CITATION.cff`

- Run `git diff` and ensure the above files were all updated correctly.
- 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.
- If the bumpversion command failed for any reason, you can update the versions yourself by doing the following:
- Manually update the version number (and release date, as needed) in `pyproject.toml`, `CHANGELOG.md` and `CITATION.cff`
- Run `npm version X.Y.Z` to update `js/package.json` and `js/package-lock.json`
- Run `uv lock` to update `uv.lock`
- From the `js/` dir, run `npm version X.Y.Z` to update `js/package.json` and `js/package-lock.json`
- From the `js/` dir, run `npm run build:labextension` to regenerate the files in `plotly/labextension/`

- Commit and push the changed files to the release branch:
```sh
Expand Down
20 changes: 16 additions & 4 deletions commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def bump_version_pyproject_toml(new_version):
subprocess.run(["uv", "lock"], check=True)

print(
f"Updated version in {pyproject_toml_path} to {new_version},",
f"SUCCESS: Updated version in {pyproject_toml_path} to {new_version},",
"and updated uv lockfile",
)
return True
Expand All @@ -346,8 +346,20 @@ def bump_version_package_json(new_version):
check=True,
)
print(
f"Updated version in {js_dir}/package.json and {js_dir}/package-lock.json to {new_version}"
f"SUCCESS: Updated version in {js_dir}/package.json and {js_dir}/package-lock.json to {new_version}"
)

# After modifying files in js/, we need to rebuild the JupyterLab extension
print("Rebuilding JupyterLab extension (this may take a few seconds)...")
subprocess.run(
["npm", "run", "build:labextension"],
cwd=js_dir,
check=True,
stdout=subprocess.DEVNULL, # Suppress stdout and stderr to avoid terminal clutter
stderr=subprocess.DEVNULL,
)
print(f"SUCCESS: Updated JupyterLab extension files in plotly/labextension")

return True


Expand Down Expand Up @@ -392,7 +404,7 @@ def bump_version_citation_cff(new_version, new_date):
with open(citation_cff_path, "w") as f:
f.write(new_content)
print(
f"Updated version in {citation_cff_path} to {new_version}",
f"SUCCESS: Updated version in {citation_cff_path} to {new_version}",
f"and date-released to {new_date}",
)
return True
Expand All @@ -414,7 +426,7 @@ def bump_version_changelog_md(new_version, new_date):
already_exists_pattern = rf"(^\s*##\s*\[ *{re.escape(new_version)} *\])"
if re.search(already_exists_pattern, content, flags=re.MULTILINE):
print(
f"Header for version {new_version} already exists ",
f"Header for version {new_version} already exists",
f"in {changelog_md_path}.",
)
return True
Expand Down
Loading