Skip to content

Commit

Permalink
Backport PR #16088: Fix migration script, use extras for its dependen…
Browse files Browse the repository at this point in the history
…cies (#16090)

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and krassowski committed Apr 2, 2024
1 parent d4805d4 commit 977264e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docs/source/extension/extension_migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,14 @@ First, make sure to update to JupyterLab 4 and install ``copier`` and some depen

.. code:: bash
pip install -U jupyterlab
pip install "copier~=8.0" jinja2-time tomli-w
pip install -U jupyterlab[upgrade-extension]
Or with ``conda``:

.. code:: bash
conda install -c conda-forge jupyterlab=4 "copier=8" jinja2-time tomli-w
conda install -c conda-forge jupyterlab=4 "copier=8" jinja2-time tomli-w "pydantic<2" "pyyaml-include<2.0"
Then at the root folder of the extension, run:
Expand Down
4 changes: 2 additions & 2 deletions jupyterlab/upgrade_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

try:
import copier
except ImportError:
msg = "Please install copier and jinja2-time"
except ModuleNotFoundError:
msg = "Please install copier; you can use `pip install jupyterlab[upgrade-extension]`"
raise RuntimeError(msg) from None

# List of files recommended to be overridden
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ dev = [
"bump2version",
"ruff==0.2.0",
]
upgrade-extension = [
"pyyaml-include<2.0",
"copier~=8.0",
"jinja2-time<0.3",
"pydantic<2.0",
"tomli-w<2.0"
]

[tool.check-wheel-contents]
ignore = ["W002", "W004"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ if [[ $GROUP == usage ]]; then
jlpm run get:dependency react-native

# Use the extension upgrade script
python -m pip install copier jinja2-time "pydantic<2"
python -m pip install .[upgrade-extension]
python -m jupyterlab.upgrade_extension --no-input jupyterlab/tests/mock_packages/extension
fi

Expand Down

0 comments on commit 977264e

Please sign in to comment.