Skip to content

Commit b93f102

Browse files
authored
Merge pull request #276 from krassowski/krassowski-update-docs-versions
Update the recommended JupyterLab version
2 parents 0238e6e + 2540353 commit b93f102

File tree

11 files changed

+148
-46
lines changed

11 files changed

+148
-46
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Open it searching for "Show diagnostics panel" in JupyterLab commands palette or
7676

7777
Either:
7878

79-
- JupyterLab >=2,<3.0.0a0
79+
- JupyterLab >=2.1.0,<3.0.0a0
8080

8181
And:
8282

@@ -99,9 +99,9 @@ Use of a python `virtualenv` or a conda env is also recommended.
9999
1. install JupyterLab
100100

101101
```bash
102-
conda install -c conda-forge 'jupyterlab>=2,<2.1.0a0'
102+
conda install -c conda-forge 'jupyterlab>=2.1,<3.0.0a0'
103103
# or
104-
pip install 'jupyterlab>=2,<2.1.0a0'
104+
pip install 'jupyterlab>=2.1,<3.0.0a0'
105105
```
106106

107107
1. install the server extension:

binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ channels:
77
dependencies:
88
# runtime dependencies
99
- python >=3.7,<3.8.0a0
10-
- jupyterlab >=2,<3.0.0a0
10+
- jupyterlab >=2.1.0,<3.0.0a0
1111
- notebook >=4.3.1
1212
# build dependencies
1313
- nodejs >=10,<14

ci/job.test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ parameters:
1212
pythons:
1313
- name: ThreeSix
1414
spec: '=3.6'
15-
lab: '>=2,<3.0.0a0'
15+
lab: '>=2.1.0,<3.0.0a0'
1616
nodejs: '>=10,<11.0.0.a0'
1717
- name: ThreeSeven
1818
spec: '=3.7'
19-
lab: '>=2,<3.0.0a0'
19+
lab: '>=2.1.0,<3.0.0a0'
2020
nodejs: '>=12,<13.0.0a0'
2121
- name: ThreeEight
2222
spec: '=3.8'
23-
lab: '>=2,<3.0.0a0'
23+
lab: '>=2.1.0,<3.0.0a0'
2424
nodejs: '>=13,<14.0.0a0'
2525
js_cov_packages:
2626
- jupyterlab-go-to-definition

docs/Installation.ipynb

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {
7+
"hide_input": true
8+
},
9+
"outputs": [],
10+
"source": [
11+
"from markdown import markdown\n",
12+
"import sys\n",
13+
"sys.path.insert(0, '..')\n",
14+
"from versions import (\n",
15+
" JUPYTER_LSP_VERSION,\n",
16+
" JUPYTERLAB_LSP_VERSION,\n",
17+
" JUPYTERLAB_NEXT_MAJOR_VERSION,\n",
18+
" JUPYTERLAB_VERSION,\n",
19+
" REQUIRED_JUPYTERLAB\n",
20+
")"
21+
]
22+
},
323
{
424
"cell_type": "markdown",
525
"metadata": {},
@@ -8,9 +28,14 @@
828
]
929
},
1030
{
11-
"cell_type": "markdown",
12-
"metadata": {},
31+
"cell_type": "code",
32+
"execution_count": null,
33+
"metadata": {
34+
"hide_input": true
35+
},
36+
"outputs": [],
1337
"source": [
38+
"%%markdown\n",
1439
"### Please Read This First\n",
1540
"\n",
1641
"Delivering LSP features to your JupyterLab **requires** three pieces:\n",
@@ -28,7 +53,7 @@
2853
"- runs in your browser, as an extension to JupyterLab\n",
2954
"- to install it, you need:\n",
3055
" - `nodejs >8`\n",
31-
" - `jupyterlab >=1.1,<2`\n",
56+
" - `jupyterlab {REQUIRED_JUPYTERLAB}`\n",
3257
"\n",
3358
"#### Language Servers\n",
3459
"\n",
@@ -49,17 +74,22 @@
4974
]
5075
},
5176
{
52-
"cell_type": "markdown",
53-
"metadata": {},
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {
80+
"hide_input": true
81+
},
82+
"outputs": [],
5483
"source": [
84+
"%%markdown\n",
5585
"#### conda (minimal python)\n",
5686
"\n",
5787
"```bash\n",
58-
"conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab=1.2' 'nodejs>8' python-language-server\n",
88+
"conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab={JUPYTERLAB_VERSION}' 'nodejs>8' python-language-server\n",
5989
"# Also consider: r-languageserver [*]\n",
6090
"source activate lsp\n",
61-
"python -m pip install 'jupyter-lsp=0.8.0' --no-deps\n",
62-
"jupyter labextension install '@krassowski/jupyterlab-lsp@1.0.0'\n",
91+
"python -m pip install 'jupyter-lsp={JUPYTER_LSP_VERSION}' --no-deps\n",
92+
"jupyter labextension install '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}'\n",
6393
"```\n",
6494
"\n",
6595
"Then run\n",
@@ -84,9 +114,14 @@
84114
]
85115
},
86116
{
87-
"cell_type": "markdown",
88-
"metadata": {},
117+
"cell_type": "code",
118+
"execution_count": null,
119+
"metadata": {
120+
"hide_input": true
121+
},
122+
"outputs": [],
89123
"source": [
124+
"%%markdown\n",
90125
"##### `Dockerfile`\n",
91126
"\n",
92127
"```dockerfile\n",
@@ -95,12 +130,12 @@
95130
"\n",
96131
"RUN conda install --quiet --yes --freeze-installed \\\n",
97132
" 'python-language-server' \\\n",
98-
" 'jupyterlab=2' \\\n",
133+
" 'jupyterlab=2.1' \\\n",
99134
" 'r-languageserver' \\\n",
100135
" && python3 -m pip install --no-cache-dir --no-deps \\\n",
101-
" 'jupyter-lsp=0.8.0' \\\n",
136+
" 'jupyter-lsp={JUPYTER_LSP_VERSION}' \\\n",
102137
" && jupyter labextension install --no-build \\\n",
103-
" '@krassowski/jupyterlab-lsp@1.0.0' \\\n",
138+
" '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}' \\\n",
104139
" && jupyter lab build --dev-build=False --minimize=True \\\n",
105140
" && conda clean --all -f -y \\\n",
106141
" && rm -rf \\\n",
@@ -202,14 +237,19 @@
202237
]
203238
},
204239
{
205-
"cell_type": "markdown",
206-
"metadata": {},
240+
"cell_type": "code",
241+
"execution_count": null,
242+
"metadata": {
243+
"hide_input": true
244+
},
245+
"outputs": [],
207246
"source": [
247+
"%%markdown\n",
208248
"#### Install Jupyter[Lab] LSP\n",
209249
"\n",
210250
"```bash\n",
211-
"pip install jupyter-lsp=0.8.0\n",
212-
"jupyter labextension install @krassowski/jupyterlab-lsp@1.0.0\n",
251+
"pip install jupyter-lsp={JUPYTER_LSP_VERSION}\n",
252+
"jupyter labextension install @krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}\n",
213253
"```"
214254
]
215255
},
@@ -245,7 +285,7 @@
245285
"name": "python",
246286
"nbconvert_exporter": "python",
247287
"pygments_lexer": "ipython3",
248-
"version": "3.7.6"
288+
"version": "3.7.5"
249289
}
250290
},
251291
"nbformat": 4,

docs/Releasing.ipynb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,33 @@
2525
"- TODO: create a `release.py` script\n",
2626
" [#88](https://github.com/krassowski/jupyterlab-lsp/issues/88)\n",
2727
"\n",
28-
"The PyPI version must be updated in the following places:\n",
28+
"The PyPI version (jupyter-lsp) must be updated in the following places:\n",
2929
"\n",
3030
"- `py_src/jupyter_lsp/_version.py` (canonical)\n",
3131
"- `azure-pipelines.yml`\n",
3232
"- `CHANGELOG.md`\n",
3333
"\n",
3434
"The npm version of `jupyterlab-lsp` must be updated in the following places:\n",
3535
"\n",
36-
"- `packages/jupyterlab-lsp/package.json` (canonical)\n",
36+
"- `packages/jupyterlab-lsp/package.json` > `version` (canonical)\n",
3737
"- `azure-pipelines.yml`\n",
3838
"- `packages/metapackage/package.json`\n",
3939
"- `CHANGELOG.md`\n",
4040
"\n",
4141
"The npm version of `lsp-ws-connection` must be updated in the following places:\n",
4242
"\n",
43-
"- `packages/lsp-ws-connection/package.json` (canonical)\n",
43+
"- `packages/lsp-ws-connection/package.json` > `version` (canonical)\n",
4444
"- `packages/jupyterlab-lsp/package.json`\n",
4545
"- `CHANGELOG.md`\n",
4646
"\n",
47+
"The JupyterLab version (if a newer is supported or required) needs to be updated\n",
48+
"in:\n",
49+
"\n",
50+
"- `packages/jupyterlab-lsp/package.json` > `devDependencies` >\n",
51+
" `@jupyterlab/application` (canonical)\n",
52+
"- `binder/environment.yml`\n",
53+
"- `README.md`\n",
54+
"\n",
4755
"### Releasing:\n",
4856
"\n",
4957
"```bash\n",
@@ -74,7 +82,7 @@
7482
"name": "python",
7583
"nbconvert_exporter": "python",
7684
"pygments_lexer": "ipython3",
77-
"version": "3.8.0"
85+
"version": "3.7.5"
7886
}
7987
},
8088
"nbformat": 4,

docs/__init__.py

Whitespace-only changes.

docs/markdown.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from IPython.core.magic import needs_local_scope, register_cell_magic
2+
from IPython.display import Markdown
3+
4+
5+
@register_cell_magic
6+
@needs_local_scope
7+
def markdown(line, cell, local_ns):
8+
"""Cell interpreted as Markdown but with variable substitution support.
9+
10+
Variables from global environment will be substituted using the standard
11+
Python format mechanism which uses single curly braces (e.g. {variable})
12+
"""
13+
return Markdown(cell.format(**local_ns))

packages/jupyterlab-lsp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"devDependencies": {
4444
"@babel/preset-env": "^7.4.3",
45-
"@jupyterlab/application": "~2.0.0",
45+
"@jupyterlab/application": "~2.1.0",
4646
"@jupyterlab/apputils": "~2.0.0",
4747
"@jupyterlab/cells": "~2.0.0",
4848
"@jupyterlab/codeeditor": "~2.0.0",
@@ -77,7 +77,7 @@
7777
"typescript": "~3.9.5"
7878
},
7979
"peerDependencies": {
80-
"@jupyterlab/application": "~2.0.0",
80+
"@jupyterlab/application": "~2.1.0",
8181
"@jupyterlab/apputils": "~2.0.0",
8282
"@jupyterlab/cells": "~2.0.0",
8383
"@jupyterlab/codeeditor": "~2.0.0",

requirements/lab.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# the version of jupyterlab
22
-r ./prod.txt
3-
jupyterlab >=2,<3.0.0a0
3+
jupyterlab >=2.1.0,<3.0.0a0

scripts/integrity.py

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,39 @@
66

77
import json
88
import pathlib
9-
import re
109
import sys
1110
import tempfile
1211
from importlib.util import find_spec
1312

1413
import jsonschema
14+
import nbformat
1515
import pytest
16+
from nbconvert.preprocessors import ExecutePreprocessor
1617

1718
try:
1819
import ruamel.yaml as yaml
1920
except ImportError:
2021
import ruamel_yaml as yaml
2122

2223
ROOT = pathlib.Path.cwd()
24+
25+
sys.path.insert(0, str(ROOT))
26+
27+
if True:
28+
# a workaround for isort 4.0 limitations
29+
# see https://github.com/timothycrosley/isort/issues/468
30+
from versions import ( # noqa
31+
REQUIRED_JUPYTERLAB as LAB_SPEC,
32+
JUPYTER_LSP_VERSION as PY_VERSION,
33+
)
34+
2335
REQS = ROOT / "requirements"
2436
BINDER = ROOT / "binder"
2537

2638
# docs
2739
MAIN_README = ROOT / "README.md"
2840
CHANGELOG = ROOT / "CHANGELOG.md"
2941

30-
# dependencies
31-
ENV = yaml.safe_load((BINDER / "environment.yml").read_text())
32-
LAB_SPEC = [
33-
d.split(" ", 1)[1]
34-
for d in ENV["dependencies"]
35-
if isinstance(d, str) and d.startswith("jupyterlab ")
36-
][0]
37-
3842
# TS stuff
3943
NPM_NS = "@krassowski"
4044
PACKAGES = {
@@ -55,8 +59,7 @@
5559

5660
# py stuff
5761
PY_NAME = "jupyter-lsp"
58-
_VERSION_PY = ROOT / "py_src" / "jupyter_lsp" / "_version.py"
59-
PY_VERSION = re.findall(r'= "(.*)"$', (_VERSION_PY).read_text())[0]
62+
6063

6164
# CI stuff
6265
PIPE_FILE = ROOT / "azure-pipelines.yml"
@@ -87,9 +90,16 @@ def the_meta_package():
8790

8891
@pytest.fixture(scope="module")
8992
def the_installation_notebook():
90-
""" loads up the installation notebook
93+
""" executes and loads up the installation notebook
9194
"""
92-
return (DOCS / "Installation.ipynb").read_text()
95+
with open(DOCS / "Installation.ipynb") as f:
96+
installation_nb = nbformat.read(f, as_version=4)
97+
executor = ExecutePreprocessor(timeout=600)
98+
99+
# modifies notebook in-place
100+
executor.preprocess(installation_nb, {"metadata": {"path": DOCS}})
101+
102+
return nbformat.writes(installation_nb)
93103

94104

95105
@pytest.mark.parametrize(
@@ -138,7 +148,16 @@ def test_ts_package_integrity(name, info, the_meta_package):
138148

139149

140150
@pytest.mark.parametrize(
141-
"path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README])
151+
"path",
152+
map(
153+
str,
154+
[
155+
REQS / "lab.txt",
156+
CI / "job.test.yml",
157+
MAIN_README,
158+
BINDER / "environment.yml",
159+
],
160+
),
142161
)
143162
def test_jlab_versions(path):
144163
""" is the version of jupyterlab consistent?

0 commit comments

Comments
 (0)