From e38440e50693818c97d9bc6ff0c2ba589ab769bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:05:05 +0100 Subject: [PATCH 01/13] Update the JupyterLab version in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6a69cbd41..0c0a29dc9 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ Use of a python `virtualenv` or a conda env is also recommended. 1. install JupyterLab ```bash - conda install -c conda-forge 'jupyterlab>=2,<2.1.0a0' + conda install -c conda-forge 'jupyterlab>=2.1,<3.0.0a0' # or - pip install 'jupyterlab>=2,<2.1.0a0' + pip install 'jupyterlab>=2.1,<3.0.0a0' ``` 1. install the server extension: From 5f4fd8827a12d6373491fd211275d0179a4625ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:08:42 +0100 Subject: [PATCH 02/13] Update the JupyterLab version in the docs --- docs/Installation.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Installation.ipynb b/docs/Installation.ipynb index 7cc44e48d..981a911df 100644 --- a/docs/Installation.ipynb +++ b/docs/Installation.ipynb @@ -28,7 +28,7 @@ "- runs in your browser, as an extension to JupyterLab\n", "- to install it, you need:\n", " - `nodejs >8`\n", - " - `jupyterlab >=1.1,<2`\n", + " - `jupyterlab >=2.1,<3`\n", "\n", "#### Language Servers\n", "\n", @@ -55,7 +55,7 @@ "#### conda (minimal python)\n", "\n", "```bash\n", - "conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab=1.2' 'nodejs>8' python-language-server\n", + "conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab=2.1' 'nodejs>8' python-language-server\n", "# Also consider: r-languageserver [*]\n", "source activate lsp\n", "python -m pip install 'jupyter-lsp=0.8.0' --no-deps\n", @@ -95,7 +95,7 @@ "\n", "RUN conda install --quiet --yes --freeze-installed \\\n", " 'python-language-server' \\\n", - " 'jupyterlab=2' \\\n", + " 'jupyterlab=2.1' \\\n", " 'r-languageserver' \\\n", " && python3 -m pip install --no-cache-dir --no-deps \\\n", " 'jupyter-lsp=0.8.0' \\\n", From d65aed9a1df9540e8c5fbe07105ea09790111609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:12:46 +0100 Subject: [PATCH 03/13] Add the JupyterLab version update to the release docs --- docs/Releasing.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index 7af47677a..1515a1373 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -25,11 +25,12 @@ "- TODO: create a `release.py` script\n", " [#88](https://github.com/krassowski/jupyterlab-lsp/issues/88)\n", "\n", - "The PyPI version must be updated in the following places:\n", + "The PyPI version (jupyter-lsp) must be updated in the following places:\n", "\n", "- `py_src/jupyter_lsp/_version.py` (canonical)\n", "- `azure-pipelines.yml`\n", "- `CHANGELOG.md`\n", + "- `docs/Installation.ipynb`\n", "\n", "The npm version of `jupyterlab-lsp` must be updated in the following places:\n", "\n", @@ -37,6 +38,7 @@ "- `azure-pipelines.yml`\n", "- `packages/metapackage/package.json`\n", "- `CHANGELOG.md`\n", + "- `docs/Installation.ipynb`\n", "\n", "The npm version of `lsp-ws-connection` must be updated in the following places:\n", "\n", @@ -44,6 +46,11 @@ "- `packages/jupyterlab-lsp/package.json`\n", "- `CHANGELOG.md`\n", "\n", + "The JupyterLab version (if a newer is supported or required) needs to be updated in:\n", + "\n", + "- `README.md` (canonical)\n", + "- `docs/Installation.ipynb`\n", + "\n", "### Releasing:\n", "\n", "```bash\n", From 5266fa54ceee34718363d4ff65e69fc61d59c310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Sun, 7 Jun 2020 15:14:51 +0100 Subject: [PATCH 04/13] One last update of JupyterLab version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c0a29dc9..7505d44ae 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Open it searching for "Show diagnostics panel" in JupyterLab commands palette or Either: -- JupyterLab >=2,<3.0.0a0 +- JupyterLab >=2.1,<3.0.0a0 And: From 68803405e2d01200c3065e67ece4061f02a77009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Krassowski?= <5832902+krassowski@users.noreply.github.com> Date: Sun, 7 Jun 2020 18:51:41 +0100 Subject: [PATCH 05/13] Require lab 2.1 --- requirements/lab.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/lab.txt b/requirements/lab.txt index 4f1a8a976..31e6d8c41 100644 --- a/requirements/lab.txt +++ b/requirements/lab.txt @@ -1,3 +1,3 @@ # the version of jupyterlab -r ./prod.txt -jupyterlab >=2,<3.0.0a0 +jupyterlab >=2.1,<3.0.0a0 From 43a08ce91266390c1083e0d79b2430b846013ce2 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 01:35:05 +0100 Subject: [PATCH 06/13] Infer versions in docs/Installation.ipynb --- docs/Installation.ipynb | 120 ++++++++++++++++++++++++++++++++++------ docs/Releasing.ipynb | 12 ++-- 2 files changed, 108 insertions(+), 24 deletions(-) diff --git a/docs/Installation.ipynb b/docs/Installation.ipynb index 981a911df..fe961a122 100644 --- a/docs/Installation.ipynb +++ b/docs/Installation.ipynb @@ -1,5 +1,71 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], + "source": [ + "from sys import path\n", + "path.insert(0, '../py_src/jupyter_lsp')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], + "source": [ + "import _version\n", + "JUPYTER_LSP_VERSION = _version.__version__" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], + "source": [ + "import json\n", + "\n", + "with open('../packages/jupyterlab-lsp/package.json') as f:\n", + " jupyterlab_lsp_package = json.load(f)\n", + "\n", + "JUPYTERLAB_LSP_VERSION = jupyterlab_lsp_package['version']\n", + "JUPYTERLAB_VERSION = jupyterlab_lsp_package['devDependencies']['@jupyterlab/application'].lstrip('~^')\n", + "JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1\n", + "\n", + "REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], + "source": [ + "from IPython.display import Markdown\n", + "from IPython.core.magic import register_cell_magic\n", + "\n", + "\n", + "@register_cell_magic\n", + "def markdown(line, cell):\n", + " \"\"\"Cell itnerpreted as Markdown but with variable substitution support.\n", + "\n", + " Variables from global environment will be substituted using the standard\n", + " Python format mechanism which uses single curly braces (e.g. {variable})\n", + " \"\"\"\n", + " return Markdown(cell.format(**globals()))" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -8,9 +74,14 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], "source": [ + "%%markdown\n", "### Please Read This First\n", "\n", "Delivering LSP features to your JupyterLab **requires** three pieces:\n", @@ -28,7 +99,7 @@ "- runs in your browser, as an extension to JupyterLab\n", "- to install it, you need:\n", " - `nodejs >8`\n", - " - `jupyterlab >=2.1,<3`\n", + " - `jupyterlab {REQUIRED_JUPYTERLAB}`\n", "\n", "#### Language Servers\n", "\n", @@ -49,17 +120,22 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], "source": [ + "%%markdown\n", "#### conda (minimal python)\n", "\n", "```bash\n", - "conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab=2.1' 'nodejs>8' python-language-server\n", + "conda create -c conda-forge -n lsp 'python >=3.7,<3.8' 'jupyterlab={JUPYTERLAB_VERSION}' 'nodejs>8' python-language-server\n", "# Also consider: r-languageserver [*]\n", "source activate lsp\n", - "python -m pip install 'jupyter-lsp=0.8.0' --no-deps\n", - "jupyter labextension install '@krassowski/jupyterlab-lsp@1.0.0'\n", + "python -m pip install 'jupyter-lsp={JUPYTER_LSP_VERSION}' --no-deps\n", + "jupyter labextension install '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}'\n", "```\n", "\n", "Then run\n", @@ -84,9 +160,14 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], "source": [ + "%%markdown\n", "##### `Dockerfile`\n", "\n", "```dockerfile\n", @@ -98,9 +179,9 @@ " 'jupyterlab=2.1' \\\n", " 'r-languageserver' \\\n", " && python3 -m pip install --no-cache-dir --no-deps \\\n", - " 'jupyter-lsp=0.8.0' \\\n", + " 'jupyter-lsp={JUPYTER_LSP_VERSION}' \\\n", " && jupyter labextension install --no-build \\\n", - " '@krassowski/jupyterlab-lsp@1.0.0' \\\n", + " '@krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}' \\\n", " && jupyter lab build --dev-build=False --minimize=True \\\n", " && conda clean --all -f -y \\\n", " && rm -rf \\\n", @@ -202,14 +283,19 @@ ] }, { - "cell_type": "markdown", - "metadata": {}, + "cell_type": "code", + "execution_count": null, + "metadata": { + "hide_input": true + }, + "outputs": [], "source": [ + "%%markdown\n", "#### Install Jupyter[Lab] LSP\n", "\n", "```bash\n", - "pip install jupyter-lsp=0.8.0\n", - "jupyter labextension install @krassowski/jupyterlab-lsp@1.0.0\n", + "pip install jupyter-lsp={JUPYTER_LSP_VERSION}\n", + "jupyter labextension install @krassowski/jupyterlab-lsp@{JUPYTERLAB_LSP_VERSION}\n", "```" ] }, @@ -245,7 +331,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.5" } }, "nbformat": 4, diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index 1515a1373..b6db5fa82 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -30,26 +30,24 @@ "- `py_src/jupyter_lsp/_version.py` (canonical)\n", "- `azure-pipelines.yml`\n", "- `CHANGELOG.md`\n", - "- `docs/Installation.ipynb`\n", "\n", "The npm version of `jupyterlab-lsp` must be updated in the following places:\n", "\n", - "- `packages/jupyterlab-lsp/package.json` (canonical)\n", + "- `packages/jupyterlab-lsp/package.json` > `version` (canonical)\n", "- `azure-pipelines.yml`\n", "- `packages/metapackage/package.json`\n", "- `CHANGELOG.md`\n", - "- `docs/Installation.ipynb`\n", "\n", "The npm version of `lsp-ws-connection` must be updated in the following places:\n", "\n", - "- `packages/lsp-ws-connection/package.json` (canonical)\n", + "- `packages/lsp-ws-connection/package.json` > `version` (canonical)\n", "- `packages/jupyterlab-lsp/package.json`\n", "- `CHANGELOG.md`\n", "\n", "The JupyterLab version (if a newer is supported or required) needs to be updated in:\n", "\n", - "- `README.md` (canonical)\n", - "- `docs/Installation.ipynb`\n", + "- `packages/jupyterlab-lsp/package.json` > `devDependencies` > `@jupyterlab/application` (canonical)\n", + "- `README.md`\n", "\n", "### Releasing:\n", "\n", @@ -81,7 +79,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.0" + "version": "3.7.5" } }, "nbformat": 4, From 8e4e2286082258b36b94f67689ec7ad44263f77f Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 14:14:20 +0100 Subject: [PATCH 07/13] Move code out of Installation.ipynb --- docs/Installation.ipynb | 64 ++++++----------------------------------- docs/markdown.py | 13 +++++++++ docs/versions.py | 22 ++++++++++++++ 3 files changed, 43 insertions(+), 56 deletions(-) create mode 100644 docs/markdown.py create mode 100644 docs/versions.py diff --git a/docs/Installation.ipynb b/docs/Installation.ipynb index fe961a122..dea30baae 100644 --- a/docs/Installation.ipynb +++ b/docs/Installation.ipynb @@ -8,62 +8,14 @@ }, "outputs": [], "source": [ - "from sys import path\n", - "path.insert(0, '../py_src/jupyter_lsp')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "hide_input": true - }, - "outputs": [], - "source": [ - "import _version\n", - "JUPYTER_LSP_VERSION = _version.__version__" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "hide_input": true - }, - "outputs": [], - "source": [ - "import json\n", - "\n", - "with open('../packages/jupyterlab-lsp/package.json') as f:\n", - " jupyterlab_lsp_package = json.load(f)\n", - "\n", - "JUPYTERLAB_LSP_VERSION = jupyterlab_lsp_package['version']\n", - "JUPYTERLAB_VERSION = jupyterlab_lsp_package['devDependencies']['@jupyterlab/application'].lstrip('~^')\n", - "JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1\n", - "\n", - "REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}'" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "hide_input": true - }, - "outputs": [], - "source": [ - "from IPython.display import Markdown\n", - "from IPython.core.magic import register_cell_magic\n", - "\n", - "\n", - "@register_cell_magic\n", - "def markdown(line, cell):\n", - " \"\"\"Cell itnerpreted as Markdown but with variable substitution support.\n", - "\n", - " Variables from global environment will be substituted using the standard\n", - " Python format mechanism which uses single curly braces (e.g. {variable})\n", - " \"\"\"\n", - " return Markdown(cell.format(**globals()))" + "from markdown import markdown\n", + "from versions import (\n", + " JUPYTER_LSP_VERSION,\n", + " JUPYTERLAB_LSP_VERSION,\n", + " JUPYTERLAB_NEXT_MAJOR_VERSION,\n", + " JUPYTERLAB_VERSION,\n", + " REQUIRED_JUPYTERLAB\n", + ")" ] }, { diff --git a/docs/markdown.py b/docs/markdown.py new file mode 100644 index 000000000..4a4fbec23 --- /dev/null +++ b/docs/markdown.py @@ -0,0 +1,13 @@ +from IPython.display import Markdown +from IPython.core.magic import register_cell_magic, needs_local_scope + + +@register_cell_magic +@needs_local_scope +def markdown(line, cell, local_ns): + """Cell interpreted as Markdown but with variable substitution support. + + Variables from global environment will be substituted using the standard + Python format mechanism which uses single curly braces (e.g. {variable}) + """ + return Markdown(cell.format(**local_ns)) diff --git a/docs/versions.py b/docs/versions.py new file mode 100644 index 000000000..87fddb657 --- /dev/null +++ b/docs/versions.py @@ -0,0 +1,22 @@ +import json +from sys import path + +path.insert(0, '../py_src/jupyter_lsp') + +import _version # noqa + + +JUPYTER_LSP_VERSION = _version.__version__ + +with open('../packages/jupyterlab-lsp/package.json') as f: + jupyterlab_lsp_package = json.load(f) + +JUPYTERLAB_LSP_VERSION = jupyterlab_lsp_package['version'] +JUPYTERLAB_VERSION = ( + jupyterlab_lsp_package + ['devDependencies'] + ['@jupyterlab/application'] + .lstrip('~^') +) +JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1 +REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}' From d9ae42d1e7990a1117177875728f2d36c4be467c Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 14:31:20 +0100 Subject: [PATCH 08/13] Lint markdown module --- docs/markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/markdown.py b/docs/markdown.py index 4a4fbec23..a07650075 100644 --- a/docs/markdown.py +++ b/docs/markdown.py @@ -1,5 +1,5 @@ +from IPython.core.magic import needs_local_scope, register_cell_magic from IPython.display import Markdown -from IPython.core.magic import register_cell_magic, needs_local_scope @register_cell_magic From 23ae0f3fab3aa56b6cf07bc79fa6fd8418426678 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 14:32:42 +0100 Subject: [PATCH 09/13] Update the integrity script to handle Installation.ipynb execution --- scripts/integrity.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/integrity.py b/scripts/integrity.py index 899f67f46..3a8356272 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -12,7 +12,9 @@ from importlib.util import find_spec import jsonschema +import nbformat import pytest +from nbconvert.preprocessors import ExecutePreprocessor try: import ruamel.yaml as yaml @@ -87,9 +89,16 @@ def the_meta_package(): @pytest.fixture(scope="module") def the_installation_notebook(): - """ loads up the installation notebook + """ executes and loads up the installation notebook """ - return (DOCS / "Installation.ipynb").read_text() + with open(DOCS / "Installation.ipynb") as f: + installation_nb = nbformat.read(f, as_version=4) + executor = ExecutePreprocessor(timeout=600) + + # modifies notebook in-place + executor.preprocess(installation_nb, {"metadata": {"path": DOCS}}) + + return nbformat.writes(installation_nb) @pytest.mark.parametrize( From f0d73a7064ae9115aabf6e46ec581a7d81589325 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 14:34:26 +0100 Subject: [PATCH 10/13] Lint releasing notebook --- docs/Releasing.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index b6db5fa82..d9299a596 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -44,9 +44,11 @@ "- `packages/jupyterlab-lsp/package.json`\n", "- `CHANGELOG.md`\n", "\n", - "The JupyterLab version (if a newer is supported or required) needs to be updated in:\n", + "The JupyterLab version (if a newer is supported or required) needs to be updated\n", + "in:\n", "\n", - "- `packages/jupyterlab-lsp/package.json` > `devDependencies` > `@jupyterlab/application` (canonical)\n", + "- `packages/jupyterlab-lsp/package.json` > `devDependencies` >\n", + " `@jupyterlab/application` (canonical)\n", "- `README.md`\n", "\n", "### Releasing:\n", From 50edea75a3cf1f54234ac815896c6ea889cf2ff4 Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 15:13:28 +0100 Subject: [PATCH 11/13] Refactor version management and integrity testing --- README.md | 2 +- binder/environment.yml | 2 +- ci/job.test.yml | 6 +++--- docs/Installation.ipynb | 2 ++ docs/Releasing.ipynb | 1 + docs/__init__.py | 0 requirements/lab.txt | 2 +- scripts/integrity.py | 22 ++++++++++------------ docs/versions.py => versions.py | 14 +++++++------- 9 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 docs/__init__.py rename docs/versions.py => versions.py (55%) diff --git a/README.md b/README.md index 815f3428c..52a4ed768 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Open it searching for "Show diagnostics panel" in JupyterLab commands palette or Either: -- JupyterLab >=2.1,<3.0.0a0 +- JupyterLab >=2.1.0,<3.0.0a0 And: diff --git a/binder/environment.yml b/binder/environment.yml index ad84ddb87..c119e143c 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -7,7 +7,7 @@ channels: dependencies: # runtime dependencies - python >=3.7,<3.8.0a0 - - jupyterlab >=2,<3.0.0a0 + - jupyterlab >=2.1.0,<3.0.0a0 - notebook >=4.3.1 # build dependencies - nodejs >=10,<14 diff --git a/ci/job.test.yml b/ci/job.test.yml index e12289aaf..ad26b6f61 100644 --- a/ci/job.test.yml +++ b/ci/job.test.yml @@ -12,15 +12,15 @@ parameters: pythons: - name: ThreeSix spec: '=3.6' - lab: '>=2,<3.0.0a0' + lab: '>=2.1.0,<3.0.0a0' nodejs: '>=10,<11.0.0.a0' - name: ThreeSeven spec: '=3.7' - lab: '>=2,<3.0.0a0' + lab: '>=2.1.0,<3.0.0a0' nodejs: '>=12,<13.0.0a0' - name: ThreeEight spec: '=3.8' - lab: '>=2,<3.0.0a0' + lab: '>=2.1.0,<3.0.0a0' nodejs: '>=13,<14.0.0a0' js_cov_packages: - jupyterlab-go-to-definition diff --git a/docs/Installation.ipynb b/docs/Installation.ipynb index dea30baae..0ed33e253 100644 --- a/docs/Installation.ipynb +++ b/docs/Installation.ipynb @@ -9,6 +9,8 @@ "outputs": [], "source": [ "from markdown import markdown\n", + "import sys\n", + "sys.path.insert(0, '..')\n", "from versions import (\n", " JUPYTER_LSP_VERSION,\n", " JUPYTERLAB_LSP_VERSION,\n", diff --git a/docs/Releasing.ipynb b/docs/Releasing.ipynb index d9299a596..0f21cc4fd 100644 --- a/docs/Releasing.ipynb +++ b/docs/Releasing.ipynb @@ -49,6 +49,7 @@ "\n", "- `packages/jupyterlab-lsp/package.json` > `devDependencies` >\n", " `@jupyterlab/application` (canonical)\n", + "- `binder/environment.yml`\n", "- `README.md`\n", "\n", "### Releasing:\n", diff --git a/docs/__init__.py b/docs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/requirements/lab.txt b/requirements/lab.txt index 31e6d8c41..f977c4b5a 100644 --- a/requirements/lab.txt +++ b/requirements/lab.txt @@ -1,3 +1,3 @@ # the version of jupyterlab -r ./prod.txt -jupyterlab >=2.1,<3.0.0a0 +jupyterlab >=2.1.0,<3.0.0a0 diff --git a/scripts/integrity.py b/scripts/integrity.py index 3a8356272..c6bd3c6bd 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -6,7 +6,6 @@ import json import pathlib -import re import sys import tempfile from importlib.util import find_spec @@ -22,6 +21,14 @@ import ruamel_yaml as yaml ROOT = pathlib.Path.cwd() + +sys.path.insert(0, str(ROOT)) + +from versions import ( # noqa + REQUIRED_JUPYTERLAB as LAB_SPEC, + JUPYTER_LSP_VERSION as PY_VERSION +) + REQS = ROOT / "requirements" BINDER = ROOT / "binder" @@ -29,14 +36,6 @@ MAIN_README = ROOT / "README.md" CHANGELOG = ROOT / "CHANGELOG.md" -# dependencies -ENV = yaml.safe_load((BINDER / "environment.yml").read_text()) -LAB_SPEC = [ - d.split(" ", 1)[1] - for d in ENV["dependencies"] - if isinstance(d, str) and d.startswith("jupyterlab ") -][0] - # TS stuff NPM_NS = "@krassowski" PACKAGES = { @@ -57,8 +56,7 @@ # py stuff PY_NAME = "jupyter-lsp" -_VERSION_PY = ROOT / "py_src" / "jupyter_lsp" / "_version.py" -PY_VERSION = re.findall(r'= "(.*)"$', (_VERSION_PY).read_text())[0] + # CI stuff PIPE_FILE = ROOT / "azure-pipelines.yml" @@ -147,7 +145,7 @@ def test_ts_package_integrity(name, info, the_meta_package): @pytest.mark.parametrize( - "path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README]) + "path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README, BINDER / "environment.yml"]) ) def test_jlab_versions(path): """ is the version of jupyterlab consistent? diff --git a/docs/versions.py b/versions.py similarity index 55% rename from docs/versions.py rename to versions.py index 87fddb657..9db8b1d86 100644 --- a/docs/versions.py +++ b/versions.py @@ -1,14 +1,14 @@ import json -from sys import path +from pathlib import Path +from re import findall -path.insert(0, '../py_src/jupyter_lsp') +ROOT = Path(__file__).resolve().parent -import _version # noqa +_VERSION_PY = ROOT / "py_src" / "jupyter_lsp" / "_version.py" +JUPYTER_LSP_VERSION = findall(r'= "(.*)"$', (_VERSION_PY).read_text())[0] -JUPYTER_LSP_VERSION = _version.__version__ - -with open('../packages/jupyterlab-lsp/package.json') as f: +with open(ROOT / "packages/jupyterlab-lsp/package.json") as f: jupyterlab_lsp_package = json.load(f) JUPYTERLAB_LSP_VERSION = jupyterlab_lsp_package['version'] @@ -19,4 +19,4 @@ .lstrip('~^') ) JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1 -REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}' +REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}.0.0a0' From da5b990423d699a0cdea4b5da8249bc5bddc787a Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 15:29:16 +0100 Subject: [PATCH 12/13] Lint integrity --- scripts/integrity.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/scripts/integrity.py b/scripts/integrity.py index c6bd3c6bd..62cd9bb7e 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -24,10 +24,13 @@ sys.path.insert(0, str(ROOT)) -from versions import ( # noqa - REQUIRED_JUPYTERLAB as LAB_SPEC, - JUPYTER_LSP_VERSION as PY_VERSION -) +if True: + # a workaround for isort 4.0 limitations + # see https://github.com/timothycrosley/isort/issues/468 + from versions import ( # noqa + REQUIRED_JUPYTERLAB as LAB_SPEC, + JUPYTER_LSP_VERSION as PY_VERSION, + ) REQS = ROOT / "requirements" BINDER = ROOT / "binder" @@ -145,7 +148,16 @@ def test_ts_package_integrity(name, info, the_meta_package): @pytest.mark.parametrize( - "path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README, BINDER / "environment.yml"]) + "path", + map( + str, + [ + REQS / "lab.txt", + CI / "job.test.yml", + MAIN_README, + BINDER / "environment.yml", + ], + ), ) def test_jlab_versions(path): """ is the version of jupyterlab consistent? From 25403532b8d448b38b34f05211748ea4fc87194a Mon Sep 17 00:00:00 2001 From: krassowski Date: Sun, 19 Jul 2020 15:31:18 +0100 Subject: [PATCH 13/13] Bump @jupyterlab/application to 2.1.0 --- packages/jupyterlab-lsp/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jupyterlab-lsp/package.json b/packages/jupyterlab-lsp/package.json index 98f78757d..1faac034f 100644 --- a/packages/jupyterlab-lsp/package.json +++ b/packages/jupyterlab-lsp/package.json @@ -42,7 +42,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.4.3", - "@jupyterlab/application": "~2.0.0", + "@jupyterlab/application": "~2.1.0", "@jupyterlab/apputils": "~2.0.0", "@jupyterlab/cells": "~2.0.0", "@jupyterlab/codeeditor": "~2.0.0", @@ -77,7 +77,7 @@ "typescript": "~3.9.5" }, "peerDependencies": { - "@jupyterlab/application": "~2.0.0", + "@jupyterlab/application": "~2.1.0", "@jupyterlab/apputils": "~2.0.0", "@jupyterlab/cells": "~2.0.0", "@jupyterlab/codeeditor": "~2.0.0",