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

[4.0] Update the cookiecutter for JupyterLab 4 and Notebook 7 #234

Merged
merged 11 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U cookiecutter jupyterlab~=3.1
run: python -m pip install -U cookiecutter "jupyterlab>=4.0.0a29,<5"

- name: Create the extension
run: |
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# Trick to use custom parameters
python -c "from cookiecutter.main import cookiecutter; import json, os; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']=d['kind'][0]; d['labextension_name']=os.getenv('NAME'); cookiecutter('.', extra_context=d, no_input=True)"
pushd ${PYNAME}
python -m pip install jupyterlab
python -m pip install "jupyterlab>=4.0.0a29,<5"
jlpm
jlpm stylelint-config-prettier-check
jlpm lint:check
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
# Trick to use custom parameters
python -c "from cookiecutter.main import cookiecutter; import json; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']=d['kind'][0]; d['test']='n'; cookiecutter('.', extra_context=d, no_input=True)"
pushd myextension
pip install jupyterlab
pip install "jupyterlab>=4.0.0a29,<5"
jlpm
jlpm lint:check
pip install -e .
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
# Trick to use custom parameters
python -c "from cookiecutter.main import cookiecutter; import json; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']=d['kind'][0]; d['has_settings']='y'; cookiecutter('.', extra_context=d, no_input=True)"
pushd myextension
pip install jupyterlab
pip install "jupyterlab>=4.0.0a29,<5"
jlpm
# It is not easily possible to get this version compatible with linter rules
jlpm lint
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
cd myextension
cat pyproject.toml
pip install .
pip install jupyterlab
pip install "jupyterlab>=4.0.0a29,<5"
jlpm
jlpm lint:check

Expand All @@ -189,7 +189,7 @@ jobs:
python -c "from cookiecutter.main import cookiecutter; import json; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']='server'; cookiecutter('.', extra_context=d, no_input=True)"
cd myextension
python -m pip install -e .[test]
python -m pip install jupyterlab
python -m pip install "jupyterlab>=4.0.0a29,<5"
jupyter labextension develop . --overwrite
jupyter server extension enable myextension

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
# Trick to use custom parameters
python -c "from cookiecutter.main import cookiecutter; import json; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']='server'; cookiecutter('.', extra_context=d, no_input=True)"
cd myextension
python -m pip install jupyterlab
python -m pip install "jupyterlab>=4.0.0a29,<5"
jupyter lab clean --all
python -m build --sdist
cd dist
Expand Down Expand Up @@ -286,11 +286,11 @@ jobs:
sudo rm -rf $(which node)

python -m pip install myextension.tar.gz
python -m pip install jupyterlab
python -m pip install "jupyterlab>=4.0.0a29,<5"
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check --no-chrome-test
python -m jupyterlab.browser_check --no-browser-test

theme:
runs-on: ubuntu-latest
Expand All @@ -316,7 +316,7 @@ jobs:
# Trick to use custom parameters
python -c "from cookiecutter.main import cookiecutter; import json; f=open('cookiecutter.json'); d=json.load(f); f.close(); d['kind']='theme'; cookiecutter('.', extra_context=d, no_input=True)"
pushd mytheme
python -m pip install jupyterlab
python -m pip install "jupyterlab>=4.0.0a29,<5"
jlpm
jlpm lint:check
python -m pip install -e .
Expand Down
8 changes: 4 additions & 4 deletions {{cookiecutter.python_name}}/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U jupyterlab~=3.1
run: python -m pip install -U "jupyterlab>=4.0.0a29,<5"

- name: Lint the extension
run: |
Expand Down Expand Up @@ -81,15 +81,15 @@ jobs:
sudo rm -rf $(which node)
sudo rm -rf $(which node)

pip install "jupyterlab~=3.1" {{ cookiecutter.python_name }}*.whl
pip install "jupyterlab>=4.0.0a29,<5" {{ cookiecutter.python_name }}*.whl

{% if cookiecutter.kind.lower() == 'server' %}
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "{{ cookiecutter.python_name }}.*OK"
{% endif %}
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "{{ cookiecutter.labextension_name }}.*OK"
python -m jupyterlab.browser_check --no-chrome-test
python -m jupyterlab.browser_check --no-browser-test
{% if cookiecutter.test.lower().startswith('y') %}
integration-tests:
name: Integration tests
Expand All @@ -114,7 +114,7 @@ jobs:
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab~=3.1" {{ cookiecutter.python_name }}*.whl
python -m pip install "jupyterlab>=4.0.0a29,<5" {{ cookiecutter.python_name }}*.whl

- name: Install dependencies
working-directory: ui-tests
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.python_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for the frontend extension.
{% endif %}
## Requirements

- JupyterLab >= 3.0
- JupyterLab >= 4.0.0a29

## Install

Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.python_name}}/binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ channels:
dependencies:
# runtime dependencies
- python >=3.8,<3.9.0a0
- jupyterlab >=3,<4.0.0a0
- jupyterlab >=4.0.0a29,<5
# labextension build dependencies
- nodejs >=14,<15
jtpio marked this conversation as resolved.
Show resolved Hide resolved
- pip
Expand Down
16 changes: 8 additions & 8 deletions {{cookiecutter.python_name}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^3.1.0"{% if cookiecutter.kind.lower() == 'theme' %},
"@jupyterlab/apputils": "^3.1.0"{% endif %}{% if cookiecutter.has_settings.lower().startswith('y') %},
"@jupyterlab/settingregistry": "^3.1.0"{% endif %}{% if cookiecutter.kind.lower() == 'server' %},
"@jupyterlab/coreutils": "^5.1.0",
"@jupyterlab/services": "^6.1.0"
"@jupyterlab/application": "^4.0.0-alpha.14"{% if cookiecutter.kind.lower() == 'theme' %},
"@jupyterlab/apputils": "^4.0.0-alpha.14"{% endif %}{% if cookiecutter.has_settings.lower().startswith('y') %},
"@jupyterlab/settingregistry": "^4.0.0-alpha.14"{% endif %}{% if cookiecutter.kind.lower() == 'server' %},
"@jupyterlab/coreutils": "^6.0.0-alpha.14",
"@jupyterlab/services": "^7.0.0-alpha.14"
{% endif %}
},
"devDependencies": {
{% if cookiecutter.test.lower().startswith('y') %}"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
{% endif %}"@jupyterlab/builder": "^3.1.0",{% if cookiecutter.test.lower().startswith('y') %}
"@jupyterlab/testutils": "^3.0.0",
{% endif %}"@jupyterlab/builder": "^4.0.0-alpha.14",{% if cookiecutter.test.lower().startswith('y') %}
"@jupyterlab/testutils": "^4.0.0-alpha.14",
"@types/jest": "^26.0.0",{% endif %}
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
Expand Down Expand Up @@ -113,7 +113,7 @@
"jupyter-releaser": {
"hooks": {
"before-build-npm": [
"python -m pip install jupyterlab~=3.1",
"python -m pip install jupyterlab>=4.0.0a29,<5",
"jlpm"
],
"before-build-python": [
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.python_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling>=1.3.1", "jupyterlab>=3.4.7,<4.0.0", "hatch-nodejs-version"]
requires = ["hatchling>=1.3.1", "jupyterlab>=4.0.0a29,<5", "hatch-nodejs-version"]
build-backend = "hatchling.build"

[project]
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.python_name}}/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"rootDir": "src",
"strict": true,
"strictNullChecks": true,
"target": "es2017",
"target": "ES2018",
"types": [{% if cookiecutter.test.lower().startswith('y') %}"jest"{% endif %}]
},
"include": ["src/*"]
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.python_name}}/ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"test": "jlpm playwright test"
},
"devDependencies": {
"@jupyterlab/galata": "^4.3.0"
"@jupyterlab/galata": "^5.0.0-alpha.14"
}
}