Skip to content
Draft
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
26 changes: 17 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ jobs:
mkdir ${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" setuptools
python -m pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "${NAME}.*OK"
Expand Down Expand Up @@ -95,10 +96,11 @@ jobs:
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d description="Let's \"rock and roll\"" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
Expand Down Expand Up @@ -139,10 +141,11 @@ jobs:
mkdir 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" setuptools
pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
Expand Down Expand Up @@ -183,12 +186,13 @@ jobs:
mkdir 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" setuptools
pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
# It is not easily possible to get this version compatible with linter rules
jlpm lint
jlpm lint:check
pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
Expand Down Expand Up @@ -290,10 +294,11 @@ jobs:
run: |
set -eux
cd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
Expand Down Expand Up @@ -336,9 +341,10 @@ jobs:
cd myextension
cat pyproject.toml
pip install .
pip install "jupyterlab>=4.0.0,<5"
pip install jupyter-builder
jlpm
jlpm lint:check
pip install "jupyterlab>=4.0.0,<5"

- name: Check pip install method
run: |
Expand Down Expand Up @@ -503,10 +509,11 @@ jobs:
mkdir 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" setuptools
python -m pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "mytheme.*OK"
Expand Down Expand Up @@ -547,10 +554,11 @@ jobs:
mkdir 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" setuptools
python -m pip install jupyter-builder setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
Expand Down Expand Up @@ -593,7 +601,7 @@ jobs:
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"
python -m pip install jupyter-builder
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
if [ ! -d node_modules/.store ] ; then echo 'nodes_module directory should contain a .store directory when using pnpm nodeLinker'; exit 1; fi;
jlpm build
Expand Down
7 changes: 4 additions & 3 deletions template/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
"build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:labextension": "jupyter-builder build .",
"build:labextension:dev": "jupyter-builder build --development True .",
"build:lib": "tsc --sourceMap",
"build:lib:prod": "tsc",
"clean": "jlpm clean:lib",
Expand All @@ -54,7 +54,7 @@
"test": "jest --coverage",{% endif %}
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w --sourceMap",
"watch:labextension": "jupyter labextension watch ."
"watch:labextension": "jupyter-builder watch ."
},
"dependencies": {
{% if kind.lower() != 'mimerenderer' %}"@jupyterlab/application": "^4.0.0"{% if kind.lower() == 'theme' %},
Expand All @@ -65,6 +65,7 @@
"@lumino/widgets": "^2.1.0"{% endif %}
},
"devDependencies": {
"@jupyter/builder": "^0.0.3",
"@jupyterlab/builder": "^4.0.0",{% if test %}
"@jupyterlab/testutils": "^4.0.0",
"@types/jest": "^29.2.0",{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0.3.2"]
requires = ["hatchling>=1.5.0", "hatch-nodejs-version>=0.3.2", "jupyter-builder"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -32,6 +32,7 @@ dynamic = ["version", "description", "authors", "urls", "keywords"]
[project.optional-dependencies]
dev = [
"jupyterlab>=4",
"jupyter-builder"
]
test = [
"coverage",
Expand Down
Loading