diff --git a/CHANGELOG.md b/CHANGELOG.md index ba21e10ed..da916bd30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## CHANGELOG -### `@krassowski/jupyterlab-lsp 3.2.0` (unreleased) +### `@krassowski/jupyterlab-lsp 3.2.0` (2021-01-24) - features: @@ -13,7 +13,7 @@ - workaround was added to enable `jedi-language-server` diagnostics ([#485]) - Julia language server will not crash when saving a non-Julia file: fixed sendSaved notification scope ([#491]) -### `jupyter-lsp 1.1.1` (unreleased) +### `jupyter-lsp 1.1.1` (2021-01-24) - bug fixes: diff --git a/packages/completion-theme/src/index.ts b/packages/completion-theme/src/index.ts index 8f9aa4346..6309a2963 100644 --- a/packages/completion-theme/src/index.ts +++ b/packages/completion-theme/src/index.ts @@ -23,12 +23,12 @@ export class CompletionThemeManager implements ILSPCompletionThemeManager { protected themes: Map; private current_theme_id: string; private icons_cache: Map; - private icon_overrides: Record; + private icon_overrides: Map; constructor(protected themeManager: IThemeManager) { this.themes = new Map(); this.icons_cache = new Map(); - this.icon_overrides = {}; + this.icon_overrides = new Map(); themeManager.themeChanged.connect(this.update_icons_set, this); } @@ -81,8 +81,8 @@ export class CompletionThemeManager implements ILSPCompletionThemeManager { } let options = this.current_theme.icons.options || {}; if (type) { - if (type in this.icon_overrides) { - type = this.icon_overrides[type]; + if (this.icon_overrides.has(type.toLowerCase())) { + type = this.icon_overrides.get(type.toLowerCase()); } type = type.substring(0, 1).toUpperCase() + type.substring(1).toLowerCase(); @@ -155,7 +155,12 @@ export class CompletionThemeManager implements ILSPCompletionThemeManager { set_icons_overrides( iconOverrides: Record ) { - this.icon_overrides = iconOverrides; + this.icon_overrides = new Map( + Object.keys(iconOverrides).map(kernelType => [ + kernelType.toLowerCase(), + iconOverrides[kernelType] + ]) + ); } } diff --git a/packages/jupyterlab-lsp/package.json b/packages/jupyterlab-lsp/package.json index 9ca59aa33..2f907361a 100644 --- a/packages/jupyterlab-lsp/package.json +++ b/packages/jupyterlab-lsp/package.json @@ -1,6 +1,6 @@ { "name": "@krassowski/jupyterlab-lsp", - "version": "3.1.0", + "version": "3.2.0", "description": "Language Server Protocol integration for JupyterLab", "keywords": [ "jupyter", diff --git a/packages/jupyterlab-lsp/schema/completion.json b/packages/jupyterlab-lsp/schema/completion.json index dc8e16545..8a8f8029d 100644 --- a/packages/jupyterlab-lsp/schema/completion.json +++ b/packages/jupyterlab-lsp/schema/completion.json @@ -34,7 +34,7 @@ }, "typesMap": { "title": "Mapping of custom kernel types to valid completion kind names", - "description": "Mapping used for icon selection. Accepted values are the names of CompletionItemKind and 'Kernel' literal. The defaults aim to provide good initial experience for Julia, Python and R kernels.", + "description": "Mapping used for icon selection. The kernel types (keys) are case-insensitive. Accepted values are the names of CompletionItemKind and 'Kernel' literal. The defaults aim to provide good initial experience for Julia, Python and R kernels.", "type": "object", "default": { "": "Kernel", diff --git a/packages/metapackage/package.json b/packages/metapackage/package.json index 060b14a13..def0d5c69 100644 --- a/packages/metapackage/package.json +++ b/packages/metapackage/package.json @@ -1,6 +1,6 @@ { "name": "@krassowski/jupyterlab-lsp-metapackage", - "version": "3.1.0", + "version": "3.2.0", "description": "JupyterLab LSP - Meta Package. All of the packages used by JupyterLab LSP", "homepage": "https://github.com/krassowski/jupyterlab-lsp", "bugs": { diff --git a/python_packages/jupyter_lsp/jupyter_lsp/_version.py b/python_packages/jupyter_lsp/jupyter_lsp/_version.py index 725e51934..f19a5ef78 100644 --- a/python_packages/jupyter_lsp/jupyter_lsp/_version.py +++ b/python_packages/jupyter_lsp/jupyter_lsp/_version.py @@ -1,3 +1,3 @@ """ single source of truth for jupyter_lsp version """ -__version__ = "1.1.0" +__version__ = "1.1.1" diff --git a/scripts/integrity.py b/scripts/integrity.py index 6b6296621..f28f776af 100644 --- a/scripts/integrity.py +++ b/scripts/integrity.py @@ -10,11 +10,15 @@ import tempfile from configparser import ConfigParser from importlib.util import find_spec +from typing import Dict +from warnings import warn import jsonschema import nbformat import pytest from nbconvert.preprocessors import ExecutePreprocessor +from packaging.requirements import Requirement +from packaging.specifiers import SpecifierSet from packaging.version import Version try: @@ -225,18 +229,37 @@ def test_contributing_versions(the_contributing_doc, the_binder_env, pkg): @pytest.mark.parametrize( - "pkg,requirement,spec", + "pkg,requirement,version,has_specifier", [ - [PY_FRONT_PATH, "jupyter_lsp", f">={PY_SERVER_VERSION}"], - [PY_FRONT_PATH, "jupyterlab", LAB_SPEC], - [PY_SERVER_PATH, "jupyter_server", REQUIRED_JUPYTER_SERVER], + [PY_FRONT_PATH, "jupyter_lsp", PY_SERVER_VERSION, False], + [PY_FRONT_PATH, "jupyterlab", LAB_SPEC, True], + [PY_SERVER_PATH, "jupyter_server", REQUIRED_JUPYTER_SERVER, True], ], ) -def test_install_requires(pkg, requirement, spec): +def test_install_requires(pkg, requirement: str, version: str, has_specifier: bool): """are python packages requirements consistent with other versions?""" config = ConfigParser() config.read(pkg / "setup.cfg") - assert f"{requirement} {spec}" in config["options"]["install_requires"] + requirements: Dict[str, Requirement] = { + requirement.name: requirement + for line in config["options"]["install_requires"].splitlines() + if line.strip() + for requirement in [Requirement(line)] + } + assert requirement in requirements + parsed_specifier = str(requirements[requirement].specifier) + raw_specifier = version if has_specifier else f">={version}" + expected_specifier = str(SpecifierSet(raw_specifier)) + + if has_specifier: + assert expected_specifier == parsed_specifier + else: + assert Version(version) in requirements[requirement].specifier + if expected_specifier != parsed_specifier: + warn( + f"Version matches, but specifier might need updating:" + f" {requirement} {parsed_specifier}; version: {version}" + ) def check_integrity():