Skip to content

Commit 4f8d5b3

Browse files
authored
Update to Jupyterlab 4 and Lumino 2 (#211)
1 parent 211695c commit 4f8d5b3

File tree

14 files changed

+7788
-5856
lines changed

14 files changed

+7788
-5856
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ jobs:
4545
yarn-
4646
4747
- name: Install dependencies
48-
run: python -m pip install -U jupyter_packaging~=0.12.3 jupyterlab~=3.6.3 pip wheel
48+
run: python -m pip install -U jupyter_packaging~=0.12.3 jupyterlab~=4.0.0 pip wheel
4949
- name: Install the extension
5050
run: |
5151
set -eux
5252
python -m pip install .
5353
- name: Integration test
5454
run: |
55-
jupyter serverextension list 2>&1 | grep -ie "jupyterlab_latex.*OK"
55+
jupyter server extension list 2>&1 | grep -ie "jupyterlab_latex.*OK"
5656
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/latex.*OK"
5757

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ lib/
1010
node_modules/
1111
npm-debug.log
1212
test/build/*
13+
/.yarn

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableImmutableInstalls: false
2+
3+
nodeLinker: node-modules

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ For more advanced usage documentation, see [here](docs/advanced.md).
2525

2626
## Requirements
2727

28-
- JupyterLab >= 3.6
28+
- JupyterLab >= 4.0
2929
- older versions are supported in previous releases available on PyPI and npm, check [releases](https://github.com/jupyterlab/jupyterlab-latex/releases)
30-
- Python >= 3.6
30+
- Python >= 3.8
3131
- An application that can compile `.tex` files to PDF (e.g., `pdflatex`, `xelatex`; use `pdflatex.exe` on Windows with MiKTeX). This application must be available as a command in the same environment as the notebook server.
3232
- An application that can process `.bib` files for producing bibliographies. As with the LaTeX command, this must be available in the same environment as the notebook server.
3333

@@ -56,7 +56,8 @@ and see the block like this in the output
5656
```
5757
jupyterlab_latex enabled
5858
- Validating jupyterlab_latex...
59-
jupyterlab_latex 3.1.0 OK
59+
Package jupyterlab_latex took 0.0010s to import
60+
jupyterlab_latex 4.0.0 OK
6061
```
6162

6263
then
@@ -129,7 +130,7 @@ The `jlpm` command is JupyterLab's pinned version of
129130
To simplify the development setup, you can use the following Conda environment:
130131

131132
```
132-
conda create -n jupyterlab-latex-env -c conda-forge python=3.10 jupyterlab=3.6.3 jupyter_packaging=0.12.3 nodejs=18
133+
conda create -n jupyterlab-latex-env -c conda-forge python=3.10 jupyterlab=4.0.0 jupyter_packaging=0.12.3 nodejs=18
133134
conda activate jupyterlab-latex-env
134135
```
135136

binder/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jupyter_packaging ~=0.10,<2
2-
jupyterlab ~=3.0
1+
jupyter_packaging ~=0.12.3,<2
2+
jupyterlab ~=4.0
33
setuptools
44
nbgitpuller

jupyterlab_latex/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def load_jupyter_server_extension(nb_server_app):
3434
Args:
3535
nb_server_app (NotebookApp): handle to the Notebook webserver instance.
3636
"""
37-
from notebook.utils import url_path_join
37+
from jupyter_server.utils import url_path_join
3838

3939
from .build import LatexBuildHandler
4040
from .synctex import LatexSynctexHandler

jupyterlab_latex/build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from tornado import gen, web
88

9-
from notebook.base.handlers import APIHandler
9+
from jupyter_server.base.handlers import APIHandler
1010

1111
from .config import LatexConfig
1212
from .util import run_command

jupyterlab_latex/synctex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pathlib import Path
88

9-
from notebook.base.handlers import APIHandler
9+
from jupyter_server.base.handlers import APIHandler
1010

1111
from .config import LatexConfig
1212
from .util import run_command

package.json

+37-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jupyterlab/latex",
3-
"version": "3.2.0",
3+
"version": "4.0.0",
44
"description": "JupyterLab extension for running LaTeX",
55
"keywords": [
66
"jupyter",
@@ -56,45 +56,55 @@
5656
]
5757
},
5858
"dependencies": {
59-
"@jupyterlab/application": "^3.6.0",
60-
"@jupyterlab/apputils": "^3.6.0",
61-
"@jupyterlab/codeeditor": "^3.6.0",
62-
"@jupyterlab/coreutils": "^5.0.0",
63-
"@jupyterlab/docmanager": "^3.6.0",
64-
"@jupyterlab/docregistry": "^3.6.0",
65-
"@jupyterlab/filebrowser": "^3.6.0",
66-
"@jupyterlab/fileeditor": "^3.6.0",
67-
"@jupyterlab/launcher": "^3.6.0",
68-
"@jupyterlab/mainmenu": "^3.6.0",
69-
"@jupyterlab/services": "^6.0.0",
70-
"@jupyterlab/settingregistry": "^3.6.0",
71-
"@jupyterlab/statedb": "^3.6.0",
72-
"@jupyterlab/ui-components": "^3.6.0",
73-
"@lumino/coreutils": "^1.5.3",
74-
"@lumino/disposable": "^1.4.3",
75-
"@lumino/domutils": "^1.2.3",
76-
"@lumino/messaging": "^1.4.3",
77-
"@lumino/widgets": "^1.16.1",
59+
"@jupyterlab/application": "^4.0.0",
60+
"@jupyterlab/apputils": "^4.0.0",
61+
"@jupyterlab/codeeditor": "^4.0.0",
62+
"@jupyterlab/coreutils": "^6.0.0",
63+
"@jupyterlab/docmanager": "^4.0.0",
64+
"@jupyterlab/docregistry": "^4.0.0",
65+
"@jupyterlab/filebrowser": "^4.0.0",
66+
"@jupyterlab/fileeditor": "^4.0.0",
67+
"@jupyterlab/launcher": "^4.0.0",
68+
"@jupyterlab/mainmenu": "^4.0.0",
69+
"@jupyterlab/services": "^7.0.0",
70+
"@jupyterlab/settingregistry": "^4.0.0",
71+
"@jupyterlab/statedb": "^4.0.0",
72+
"@jupyterlab/ui-components": "^4.0.0",
73+
"@lumino/coreutils": "^2.1.1",
74+
"@lumino/disposable": "^2.1.1",
75+
"@lumino/domutils": "^2.0.0",
76+
"@lumino/messaging": "^2.0.0",
77+
"@lumino/signaling": "2.1.1",
78+
"@lumino/widgets": "^2.1.1",
7879
"pdfjs-dist": "2.4.456",
79-
"react": "^17.0.2",
80-
"react-dom": "^17.0.2",
80+
"react": "^18.2.0",
81+
"react-dom": "^18.2.0",
8182
"yjs": "^13.6.1"
8283
},
8384
"devDependencies": {
84-
"@jupyterlab/builder": "^3.6.3",
85-
"@types/react": "^17.0.2",
86-
"@types/react-dom": "^17.0.2",
85+
"@jupyterlab/builder": "^4.0.0",
86+
"@types/json-schema": "^7.0.11",
87+
"@types/react": "^18.2.6",
88+
"@types/react-dom": "^18.2.4",
8789
"@typescript-eslint/eslint-plugin": "^4.13.0",
8890
"@typescript-eslint/parser": "^4.13.0",
91+
"css-loader": "^6.7.1",
8992
"eslint": "^7.5.0",
9093
"eslint-config-prettier": "^6.10.1",
9194
"eslint-plugin-prettier": "^3.1.2",
9295
"husky": "^2.4.1",
9396
"lint-staged": "^8.2.1",
9497
"mkdirp": "^1.0.3",
9598
"npm-run-all": "^4.1.5",
96-
"prettier": "^1.19.0",
97-
"rimraf": "^3.0.2",
99+
"prettier": "^2.8.7",
100+
"rimraf": "^4.4.1",
101+
"source-map-loader": "^1.0.2",
102+
"style-loader": "^3.3.1",
103+
"stylelint": "^14.9.1",
104+
"stylelint-config-prettier": "^9.0.4",
105+
"stylelint-config-recommended": "^8.0.0",
106+
"stylelint-config-standard": "^26.0.0",
107+
"stylelint-prettier": "^2.0.0",
98108
"tslint": "^5.18.0",
99109
"tslint-config-prettier": "^1.18.0",
100110
"tslint-plugin-prettier": "^2.0.1",

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
requires = [
33
"jupyter_packaging~=0.12,<2",
4-
"jupyterlab~=3.6"
4+
"jupyterlab==4.0.0"
55
]
66
build-backend = "jupyter_packaging.build_api"
77

setup.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@
6969
zip_safe=False,
7070
include_package_data=True,
7171
keywords= ['Jupyter', 'JupyterLab', 'LaTeX'],
72-
python_requires = '>=3.6',
72+
python_requires = '>=3.8',
7373
classifiers = [
7474
'Intended Audience :: Developers',
7575
'Intended Audience :: System Administrators',
7676
'Intended Audience :: Science/Research',
7777
'License :: OSI Approved :: BSD License',
7878
'Programming Language :: Python',
7979
'Programming Language :: Python :: 3',
80-
'Programming Language :: Python :: 3.6',
81-
'Programming Language :: Python :: 3.7',
8280
'Programming Language :: Python :: 3.8',
8381
'Programming Language :: Python :: 3.9',
82+
'Programming Language :: Python :: 3.10',
83+
'Programming Language :: Python :: 3.11',
8484
'Framework :: Jupyter',
8585
],
8686
install_requires=[
87-
'jupyterlab>=3.6,<4',
88-
'jupyter_server>=2'
87+
'jupyterlab>=4,<5',
88+
'jupyter_server>=2,<3'
8989
],
9090
cmdclass=wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets)
9191
)

src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { ILauncher } from '@jupyterlab/launcher';
4242

4343
import { LabIcon } from '@jupyterlab/ui-components';
4444

45-
import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
45+
import { IDefaultFileBrowser } from '@jupyterlab/filebrowser';
4646

4747
import { ICommandPalette } from '@jupyterlab/apputils';
4848

@@ -109,7 +109,7 @@ type ISynctexEditOptions = PDFJSViewer.IPosition;
109109
const latexPlugin: JupyterFrontEndPlugin<void> = {
110110
id: latexPluginId,
111111
requires: [
112-
IFileBrowserFactory,
112+
IDefaultFileBrowser,
113113
IDocumentManager,
114114
IEditorTracker,
115115
ILabShell,
@@ -220,7 +220,7 @@ function synctexViewRequest(
220220
*/
221221
function activateLatexPlugin(
222222
app: JupyterFrontEnd,
223-
browserFactory: IFileBrowserFactory,
223+
browser: IDefaultFileBrowser,
224224
manager: IDocumentManager,
225225
editorTracker: IEditorTracker,
226226
shell: ILabShell,
@@ -454,7 +454,7 @@ function activateLatexPlugin(
454454
execute: async args => {
455455
// Get the directory in which the LaTeX file must be created;
456456
// otherwise take the current filebrowser directory
457-
const cwd = args['cwd'] || browserFactory.defaultBrowser.model.path;
457+
const cwd = args['cwd'] || browser.model.path;
458458

459459
// Create a new untitled LaTeX file
460460
const model = await commands.execute('docmanager:new-untitled', {

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lib": ["DOM", "ES6"],
1010
"module": "esnext",
1111
"moduleResolution": "node",
12-
"target": "ES6",
12+
"target": "ESNext",
1313
"outDir": "./lib",
1414
"jsx": "react"
1515
},

0 commit comments

Comments
 (0)