From 30b0e03096a5cdcdc140261899b63835900642bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Jun 2023 08:48:13 +0200 Subject: [PATCH 1/2] Update documentation for copier v8.0.0 --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cf42359..6f9a1d8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ a JupyterLab extension. Three kinds of extension are supported: With `pip`: ```sh -pip install copier jinja2-time +pip install "copier~=7.2" jinja2-time ``` Or with `conda` / `mamba`: @@ -35,9 +35,11 @@ cd myextension 3. Use copier to generate an extension, following the prompts to fill all required information. ``` -copier https://github.com/jupyterlab/extension-template . +copier copy https://github.com/jupyterlab/extension-template . ``` +> If you use copier v8+, you will need to pass the flag `--UNSAFE` (see [documentation](https://copier.readthedocs.io/en/stable/configuring/#unsafe)). + > If you are using Visual Studio Code, you may be interested in the > [configuration template](https://github.com/jupyterlab/vscode-config-template) for JupyterLab extension. @@ -46,9 +48,11 @@ copier https://github.com/jupyterlab/extension-template . If you'd like to generate an extension for a older release, use the `--vcs-ref` option and give a tag or commit from this repository. ```sh -copier --vcs-ref v4.0.0 https://github.com/jupyterlab/extension-template . +copier --vcs-ref v4.0.0 copy https://github.com/jupyterlab/extension-template . ``` +> If you use copier v8+, you will need to pass the flag `--UNSAFE` (see [documentation](https://copier.readthedocs.io/en/stable/configuring/#unsafe)). + > If you are looking for a template compatible with JupyterLab version prior to 4.0.0, look at > the [cookiecutter template](https://github.com/jupyterlab/extension-cookiecutter-ts) or the > [mimerenderer template](https://github.com/jupyterlab/mimerender-cookiecutter-ts). @@ -66,6 +70,8 @@ with a newer version of the template by executing the command: copier update ``` +> If you use copier v8+, you will need to pass the flag `--UNSAFE` (see [documentation](https://copier.readthedocs.io/en/stable/configuring/#unsafe)). + ## A simple example Your new extension includes a very simple example of a working extension. Use this example as a guide to build your own extension. Have a look at the [extension examples](https://github.com/jupyterlab/extension-examples) repository for more information on various JupyterLab features. From 77c907bc2deb056f4df72b9bb9150b04ce86a704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 5 Jun 2023 08:52:57 +0200 Subject: [PATCH 2/2] Update CI for 8.0.0 --- .github/workflows/check-tests.yml | 8 ++++---- .github/workflows/main.yml | 32 +++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check-tests.yml b/.github/workflows/check-tests.yml index 11ae0b9..1a0731c 100644 --- a/.github/workflows/check-tests.yml +++ b/.github/workflows/check-tests.yml @@ -20,13 +20,13 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install dependencies - run: python -m pip install -U "copier>=7.1.0" jinja2-time "jupyterlab>=4.0.0,<5" + run: python -m pip install -U "copier>=8.0.0" jinja2-time "jupyterlab>=4.0.0,<5" - name: Create the extension run: | set -eux mkdir myextension - python -m copier -l -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension cat myextension/pyproject.toml - name: Test the extension @@ -88,13 +88,13 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install dependencies - run: python -m pip install -U "copier>=7.1.0" jinja2-time "jupyterlab>=4.0.0,<5" + run: python -m pip install -U "copier>=8.0.0" jinja2-time "jupyterlab>=4.0.0,<5" - name: Create the extension run: | set -eux mkdir myextension - python -m copier -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension - name: Install the extension working-directory: myextension diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c99e1c..cc7ae55 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - name: Install dependencies run: | - python -m pip install "copier>=7.1.0" jinja2-time + python -m pip install "copier>=8.0.0" jinja2-time - name: Create pure frontend extension env: @@ -45,7 +45,7 @@ jobs: run: | set -eux mkdir ${NAME} - python -m copier -l -d author_name="My Name" -d labextension_name="${NAME}" -d python_name="${PYNAME}" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . ${NAME} + python -m copier copy -l -d author_name="My Name" -d labextension_name="${NAME}" -d python_name="${PYNAME}" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . ${NAME} pushd ${NAME} python -m pip install "jupyterlab>=4.0.0,<5" jlpm @@ -79,7 +79,7 @@ jobs: - name: Install dependencies run: | - python -m pip install copier>=7.1.0 jinja2-time + python -m pip install copier>=8.0.0 jinja2-time - name: Setup Git run: | @@ -90,7 +90,7 @@ jobs: run: | set -eux mkdir myextension - python -m copier -l -d author_name="My Name" -d test=n -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d author_name="My Name" -d test=n -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension pushd myextension pip install "jupyterlab>=4.0.0,<5" jlpm @@ -123,7 +123,7 @@ jobs: - name: Install dependencies run: | - python -m pip install copier>=7.1.0 jinja2-time + python -m pip install copier>=8.0.0 jinja2-time - name: Setup Git run: | @@ -134,7 +134,7 @@ jobs: run: | set -eux mkdir myextension - python -m copier -l -d author_name="My Name" -d has_settings=y -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d author_name="My Name" -d has_settings=y -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension pushd myextension pip install "jupyterlab>=4.0.0,<5" jlpm @@ -171,7 +171,7 @@ jobs: - name: Install dependencies run: | - python -m pip install "copier>=7.1.0" jinja2-time build + python -m pip install "copier>=8.0.0" jinja2-time build - name: Setup Git run: | @@ -181,7 +181,7 @@ jobs: - name: Create server extension pip install run: | mkdir myextension - python -m copier -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension cd myextension cat pyproject.toml pip install . @@ -207,7 +207,7 @@ jobs: - name: Create server extension pip develop run: | mkdir myextension - python -m copier -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension cd myextension python -m pip install -e .[test] python -m pip install "jupyterlab>=4.0.0,<5" @@ -245,7 +245,7 @@ jobs: - name: Install server extension from a tarball run: | mkdir myextension - python -m copier -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension cd myextension python -m pip install "jupyterlab>=4.0.0,<5" jupyter lab clean --all @@ -335,7 +335,7 @@ jobs: - name: Install dependencies run: | - python -m pip install "copier>=7.1.0" jinja2-time build + python -m pip install "copier>=8.0.0" jinja2-time build - name: Setup Git run: | @@ -346,7 +346,7 @@ jobs: run: | set -eux mkdir mytheme - python -m copier -l -d kind=theme -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . mytheme + python -m copier copy -l -d kind=theme -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . mytheme pushd mytheme python -m pip install "jupyterlab>=4.0.0,<5" jlpm @@ -379,7 +379,7 @@ jobs: - name: Install dependencies run: | - python -m pip install "copier>=7.1.0" jinja2-time build + python -m pip install "copier>=8.0.0" jinja2-time build - name: Setup Git run: | @@ -390,7 +390,7 @@ jobs: run: | set -eux mkdir myextension - python -m copier -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension pushd myextension python -m pip install "jupyterlab>=4.0.0,<5" jlpm @@ -422,7 +422,7 @@ jobs: - name: Install dependencies run: | - python -m pip install "copier>=7.1.0" jinja2-time + python -m pip install "copier>=8.0.0" jinja2-time - name: Setup Git run: | @@ -435,7 +435,7 @@ jobs: run: | set -eux mkdir myextension - python -m copier -l -d kind=${KIND} -d author_name="My Name" -d labextension_name=myextension -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD . myextension + python -m copier copy -l -d kind=${KIND} -d author_name="My Name" -d labextension_name=myextension -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension pushd myextension sed -i 's/^\(nodeLinker:\s\).*$/\1pnpm/' .yarnrc.yml python -m pip install "jupyterlab>=4.0.0,<5"