Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation for copier v8.0.0 #13

Merged
merged 2 commits into from
Jun 6, 2023
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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 .
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand All @@ -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.

Expand All @@ -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).
Expand All @@ -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.