Skip to content

Update to Jupyterlab 4 and Lumino 2 #211

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

Merged
merged 13 commits into from
May 24, 2023
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
yarn-

- name: Install dependencies
run: python -m pip install -U jupyter_packaging~=0.12.3 jupyterlab~=3.6.3 pip wheel
run: python -m pip install -U jupyter_packaging~=0.12.3 jupyterlab~=4.0.0 pip wheel
- name: Install the extension
run: |
set -eux
python -m pip install .
- name: Integration test
run: |
jupyter serverextension list 2>&1 | grep -ie "jupyterlab_latex.*OK"
jupyter server extension list 2>&1 | grep -ie "jupyterlab_latex.*OK"
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/latex.*OK"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ lib/
node_modules/
npm-debug.log
test/build/*
/.yarn
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enableImmutableInstalls: false

nodeLinker: node-modules
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ For more advanced usage documentation, see [here](docs/advanced.md).

## Requirements

- JupyterLab >= 3.6
- JupyterLab >= 4.0
- older versions are supported in previous releases available on PyPI and npm, check [releases](https://github.com/jupyterlab/jupyterlab-latex/releases)
- Python >= 3.6
- Python >= 3.8
- 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.
- 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.

Expand Down Expand Up @@ -56,7 +56,8 @@ and see the block like this in the output
```
jupyterlab_latex enabled
- Validating jupyterlab_latex...
jupyterlab_latex 3.1.0 OK
Package jupyterlab_latex took 0.0010s to import
jupyterlab_latex 4.0.0 OK
```

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

```
conda create -n jupyterlab-latex-env -c conda-forge python=3.10 jupyterlab=3.6.3 jupyter_packaging=0.12.3 nodejs=18
conda create -n jupyterlab-latex-env -c conda-forge python=3.10 jupyterlab=4.0.0 jupyter_packaging=0.12.3 nodejs=18
conda activate jupyterlab-latex-env
```

Expand Down
4 changes: 2 additions & 2 deletions binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jupyter_packaging ~=0.10,<2
jupyterlab ~=3.0
jupyter_packaging ~=0.12.3,<2
jupyterlab ~=4.0
setuptools
nbgitpuller
2 changes: 1 addition & 1 deletion jupyterlab_latex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def load_jupyter_server_extension(nb_server_app):
Args:
nb_server_app (NotebookApp): handle to the Notebook webserver instance.
"""
from notebook.utils import url_path_join
from jupyter_server.utils import url_path_join

from .build import LatexBuildHandler
from .synctex import LatexSynctexHandler
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_latex/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from tornado import gen, web

from notebook.base.handlers import APIHandler
from jupyter_server.base.handlers import APIHandler

from .config import LatexConfig
from .util import run_command
Expand Down
2 changes: 1 addition & 1 deletion jupyterlab_latex/synctex.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pathlib import Path

from notebook.base.handlers import APIHandler
from jupyter_server.base.handlers import APIHandler

from .config import LatexConfig
from .util import run_command
Expand Down
64 changes: 37 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jupyterlab/latex",
"version": "3.2.0",
"version": "4.0.0",
"description": "JupyterLab extension for running LaTeX",
"keywords": [
"jupyter",
Expand Down Expand Up @@ -56,45 +56,55 @@
]
},
"dependencies": {
"@jupyterlab/application": "^3.6.0",
"@jupyterlab/apputils": "^3.6.0",
"@jupyterlab/codeeditor": "^3.6.0",
"@jupyterlab/coreutils": "^5.0.0",
"@jupyterlab/docmanager": "^3.6.0",
"@jupyterlab/docregistry": "^3.6.0",
"@jupyterlab/filebrowser": "^3.6.0",
"@jupyterlab/fileeditor": "^3.6.0",
"@jupyterlab/launcher": "^3.6.0",
"@jupyterlab/mainmenu": "^3.6.0",
"@jupyterlab/services": "^6.0.0",
"@jupyterlab/settingregistry": "^3.6.0",
"@jupyterlab/statedb": "^3.6.0",
"@jupyterlab/ui-components": "^3.6.0",
"@lumino/coreutils": "^1.5.3",
"@lumino/disposable": "^1.4.3",
"@lumino/domutils": "^1.2.3",
"@lumino/messaging": "^1.4.3",
"@lumino/widgets": "^1.16.1",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/docmanager": "^4.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/filebrowser": "^4.0.0",
"@jupyterlab/fileeditor": "^4.0.0",
"@jupyterlab/launcher": "^4.0.0",
"@jupyterlab/mainmenu": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/statedb": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@lumino/coreutils": "^2.1.1",
"@lumino/disposable": "^2.1.1",
"@lumino/domutils": "^2.0.0",
"@lumino/messaging": "^2.0.0",
"@lumino/signaling": "2.1.1",
"@lumino/widgets": "^2.1.1",
"pdfjs-dist": "2.4.456",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"yjs": "^13.6.1"
},
"devDependencies": {
"@jupyterlab/builder": "^3.6.3",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.2",
"@jupyterlab/builder": "^4.0.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"css-loader": "^6.7.1",
"eslint": "^7.5.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"husky": "^2.4.1",
"lint-staged": "^8.2.1",
"mkdirp": "^1.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.0",
"rimraf": "^3.0.2",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"source-map-loader": "^1.0.2",
"style-loader": "^3.3.1",
"stylelint": "^14.9.1",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-recommended": "^8.0.0",
"stylelint-config-standard": "^26.0.0",
"stylelint-prettier": "^2.0.0",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"jupyter_packaging~=0.12,<2",
"jupyterlab~=3.6"
"jupyterlab==4.0.0"
]
build-backend = "jupyter_packaging.build_api"

Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@
zip_safe=False,
include_package_data=True,
keywords= ['Jupyter', 'JupyterLab', 'LaTeX'],
python_requires = '>=3.6',
python_requires = '>=3.8',
classifiers = [
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Framework :: Jupyter',
],
install_requires=[
'jupyterlab>=3.6,<4',
'jupyter_server>=2'
'jupyterlab>=4,<5',
'jupyter_server>=2,<3'
],
cmdclass=wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets)
)
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { ILauncher } from '@jupyterlab/launcher';

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

import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
import { IDefaultFileBrowser } from '@jupyterlab/filebrowser';

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

Expand Down Expand Up @@ -109,7 +109,7 @@ type ISynctexEditOptions = PDFJSViewer.IPosition;
const latexPlugin: JupyterFrontEndPlugin<void> = {
id: latexPluginId,
requires: [
IFileBrowserFactory,
IDefaultFileBrowser,
IDocumentManager,
IEditorTracker,
ILabShell,
Expand Down Expand Up @@ -220,7 +220,7 @@ function synctexViewRequest(
*/
function activateLatexPlugin(
app: JupyterFrontEnd,
browserFactory: IFileBrowserFactory,
browser: IDefaultFileBrowser,
manager: IDocumentManager,
editorTracker: IEditorTracker,
shell: ILabShell,
Expand Down Expand Up @@ -454,7 +454,7 @@ function activateLatexPlugin(
execute: async args => {
// Get the directory in which the LaTeX file must be created;
// otherwise take the current filebrowser directory
const cwd = args['cwd'] || browserFactory.defaultBrowser.model.path;
const cwd = args['cwd'] || browser.model.path;

// Create a new untitled LaTeX file
const model = await commands.execute('docmanager:new-untitled', {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lib": ["DOM", "ES6"],
"module": "esnext",
"moduleResolution": "node",
"target": "ES6",
"target": "ESNext",
"outDir": "./lib",
"jsx": "react"
},
Expand Down
Loading