Skip to content

Commit 944ff37

Browse files
authored
Merge pull request #365 from fcollonval/fcollonval/issue242
Mention conda package in the documentation
2 parents ea90dbd + 925ca05 commit 944ff37

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,16 @@ Use of a python `virtualenv` or a conda env is also recommended.
9696
conda install -c conda-forge python=3
9797
```
9898

99-
1. install JupyterLab
99+
1. install JupyterLab and the server extension
100100

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

107-
1. install the server extension:
108-
109-
```bash
110-
pip install jupyter-lsp
111-
```
107+
> Note: With conda, you could take advantage of the meta-packages `jupyter-lsp-python`
108+
> or `jupyter-lsp-r` to install the language server and the server extension.
112109
113110
1. install `nodejs`
114111

@@ -175,6 +172,9 @@ Use of a python `virtualenv` or a conda env is also recommended.
175172
To update previously installed extensions:
176173

177174
```bash
175+
conda update jupyter-lsp
176+
jupyter labextension update @krassowski/jupyterlab-lsp
177+
# or
178178
pip install -U jupyter-lsp
179179
jupyter labextension update @krassowski/jupyterlab-lsp
180180
```

docs/Installation.ipynb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@
9797
"#### conda (minimal python)\n",
9898
"\n",
9999
"```bash\n",
100-
"conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab={JUPYTERLAB_VERSION}' 'nodejs>10' python-language-server\n",
101-
"# Also consider: r-languageserver [*]\n",
102-
"source activate lsp\n",
103-
"python -m pip install 'jupyter-lsp={JUPYTER_LSP_VERSION}' --no-deps\n",
100+
"conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab={JUPYTERLAB_VERSION}' 'nodejs>10' 'jupyter-lsp-python={JUPYTER_LSP_VERSION}'\n",
101+
"# jupyter-lsp-python includes both the server extension (jupyter-lsp) and pyls third-party server (python-language-server)\n",
102+
"# if you swap it with another pre-made bundle, jupyter-lsp-r, you will get the server extension and r-languageserver;\n",
103+
"# alternatively, use jupyter-lsp and manually install a language server of your choice (see the table below).\n",
104+
"conda activate lsp\n",
104105
"jupyter labextension install '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}'\n",
105106
"```\n",
106107
"\n",
@@ -146,7 +147,6 @@
146147
" 'r-languageserver' \\\n",
147148
" 'texlab' \\\n",
148149
" 'chktex' \\\n",
149-
" && python3 -m pip install --no-cache-dir --no-deps \\\n",
150150
" 'jupyter-lsp={JUPYTER_LSP_VERSION}' \\\n",
151151
" && jupyter labextension install --no-build \\\n",
152152
" '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}' \\\n",
@@ -261,6 +261,15 @@
261261
"%%markdown\n",
262262
"#### Install Jupyter[Lab] LSP\n",
263263
"\n",
264+
"##### conda\n",
265+
"\n",
266+
"```bash\n",
267+
"conda install jupyter-lsp={JUPYTER_LSP_VERSION}\n",
268+
"jupyter labextension install @krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}\n",
269+
"```\n",
270+
"\n",
271+
"##### pip\n",
272+
"\n",
264273
"```bash\n",
265274
"pip install jupyter-lsp={JUPYTER_LSP_VERSION}\n",
266275
"jupyter labextension install @krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}\n",

py_src/jupyter_lsp/specs/pyls.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ class PythonLanguageServer(PythonModuleSpec):
1717
conda="conda install -c conda-forge python-language-server",
1818
),
1919
extend=[
20-
dict(display_name="pyls-mypy", install=dict(pip="pip install pyls-mypy")),
21-
dict(display_name="pyls-black", install=dict(pip="pip install pyls-black")),
20+
dict(
21+
display_name="pyls-mypy",
22+
install=dict(
23+
pip="pip install pyls-mypy", conda="conda install pyls-mypy"
24+
),
25+
),
26+
dict(
27+
display_name="pyls-black",
28+
install=dict(
29+
pip="pip install pyls-black", conda="conda install pyls-black"
30+
),
31+
),
2232
dict(display_name="pyls-isort", install=dict(pip="pip install pyls-isort")),
2333
],
2434
config_schema=load_config_schema(key),

scripts/integrity.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ def test_changelog_versions(pkg, version):
183183

184184
@pytest.mark.parametrize(
185185
"pkg,sep,version,expected",
186-
[[PY_NAME, "=", PY_VERSION, 3], [JS_LSP_NAME, "@", JS_LSP_VERSION, 3]],
186+
[
187+
[PY_NAME, "=", PY_VERSION, 3],
188+
[PY_NAME + "-python", "=", PY_VERSION, 1],
189+
[JS_LSP_NAME, "@", JS_LSP_VERSION, 4]
190+
],
187191
)
188192
def test_installation_versions(the_installation_notebook, pkg, sep, version, expected):
189193
assert the_installation_notebook.count(f"{pkg}{sep}{version}") == expected

0 commit comments

Comments
 (0)