Skip to content

Commit

Permalink
Bump dependencies to fix CI (#335)
Browse files Browse the repository at this point in the history
* Bump dependencies to fix CI

* Update metapackage on release

* Install `tomlkit` before version bump
  • Loading branch information
krassowski authored Aug 13, 2024
1 parent f04736a commit 7ea2cd5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 3 additions & 3 deletions projects/jupyter-collaboration/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ classifiers = [
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
]
dependencies = [
"jupyter-server-ydoc>=1.0.0a0",
"jupyter-collaboration-ui>=1.0.0a0",
"jupyter-docprovider>=1.0.0a0"
"jupyter-server-ydoc>=1.0.0b1",
"jupyter-collaboration-ui>=1.0.0b1",
"jupyter-docprovider>=1.0.0b1"
]
dynamic = ["version"]

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ dynamic = ["version"]
dev = [
"click",
"pre-commit",
"jupyter_releaser"
"jupyter_releaser",
"tomlkit"
]
test = [
"jupyter-server-ydoc[test] @ {root:uri}/projects/jupyter-server-ydoc",
Expand Down Expand Up @@ -80,7 +81,7 @@ before-build-python = [
"jlpm clean:lib"
]
before-bump-version = [
"python -m pip install -U jupyterlab",
"python -m pip install -U jupyterlab tomlkit",
"jlpm"
]

Expand Down
16 changes: 16 additions & 0 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path

import click
import tomlkit
from jupyter_releaser.util import get_version, run
from pkg_resources import parse_version # type: ignore

Expand Down Expand Up @@ -80,6 +81,8 @@ def bump(force, skip_if_dirty, spec):

HERE = Path(__file__).parent.parent.resolve()

project_pins = {}

# bump the Python packages
for version_file in HERE.glob("projects/**/_version.py"):
content = version_file.read_text().splitlines()
Expand All @@ -92,6 +95,19 @@ def bump(force, skip_if_dirty, spec):
current = current.strip("'\"")
version_spec = increment_version(current, spec)
version_file.write_text(f'__version__ = "{version_spec}"\n')
project = version_file.parent.name
project_pins[project] = version_spec

# bump the required version in jupyter-collaboration metapackage
# to ensure that users can just upgrade `jupyter-collaboration`
# and get all fixes for free
metapackage = "jupyter-collaboration"
metapackage_toml_path = HERE / "projects" / metapackage / "pyproject.toml"
metapackage_toml = tomlkit.parse(metapackage_toml_path.read_text())
metapackage_toml["dependencies"] = [
key + ">=" + project_pins[key] for key in sorted(project_pins) if key != metapackage
]
metapackage_toml_path.write_text(tomlkit.dumps(metapackage_toml))

path = HERE.joinpath("package.json")
if path.exists():
Expand Down

0 comments on commit 7ea2cd5

Please sign in to comment.