python3Packages.lsprotocol: split 2023/2025 and use 2023 by default

The 2025 version is a breaking change, we need to rollback to the 2023
version to fix all packages that depend on it.

This still provides the 2025 version for future packages that will
depend on the latest version.

Changed files
+85 -11
pkgs
development
python-modules
lsprotocol
top-level
+70
pkgs/development/python-modules/lsprotocol/2023.nix
···
···
+
{
+
lib,
+
attrs,
+
buildPythonPackage,
+
cattrs,
+
fetchFromGitHub,
+
flit-core,
+
importlib-resources,
+
jsonschema,
+
pyhamcrest,
+
pytestCheckHook,
+
}:
+
+
buildPythonPackage rec {
+
pname = "lsprotocol";
+
version = "2023.0.1";
+
pyproject = true;
+
+
src = fetchFromGitHub {
+
owner = "microsoft";
+
repo = "lsprotocol";
+
tag = version;
+
hash = "sha256-PHjLKazMaT6W4Lve1xNxm6hEwqE3Lr2m5L7Q03fqb68=";
+
};
+
+
sourceRoot = "${src.name}/packages/python";
+
+
build-system = [
+
flit-core
+
];
+
+
dependencies = [
+
attrs
+
cattrs
+
];
+
+
nativeCheckInputs = [ pytestCheckHook ];
+
+
checkInputs = [
+
importlib-resources
+
jsonschema
+
pyhamcrest
+
];
+
+
disabledTests = [
+
# cattrs.errors.StructureHandlerNotFoundError: Unsupported type:
+
# typing.Union[str, lsprotocol.types.NotebookDocumentFilter_Type1,
+
# lsprotocol.types.NotebookDocumentFilter_Type2,
+
# lsprotocol.types.NotebookDocumentFilter_Type3, NoneType]. Register
+
# a structure hook for it.
+
"test_notebook_sync_options"
+
];
+
+
preCheck = ''
+
cd ../../
+
'';
+
+
pythonImportsCheck = [ "lsprotocol" ];
+
+
meta = {
+
description = "Python implementation of the Language Server Protocol";
+
homepage = "https://github.com/microsoft/lsprotocol";
+
changelog = "https://github.com/microsoft/lsprotocol/releases/tag/${src.tag}";
+
license = lib.licenses.mit;
+
maintainers = with lib.maintainers; [
+
doronbehar
+
fab
+
];
+
};
+
}
+10 -10
pkgs/development/python-modules/lsprotocol/default.nix pkgs/development/python-modules/lsprotocol/2025.nix
···
jsonschema,
pyhamcrest,
pytestCheckHook,
-
pythonOlder,
}:
buildPythonPackage rec {
pname = "lsprotocol";
version = "2025.0.0";
pyproject = true;
-
-
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "microsoft";
···
hash = "sha256-DrWXHMgDZSQQ6vsmorThMrUTX3UQU+DajSEOdxoXrFQ=";
};
-
postPatch = ''
-
pushd packages/python
-
'';
build-system = [
flit-core
···
];
disabledTests = [
"test_notebook_sync_options"
];
preCheck = ''
-
popd
'';
pythonImportsCheck = [ "lsprotocol" ];
-
meta = with lib; {
description = "Python implementation of the Language Server Protocol";
homepage = "https://github.com/microsoft/lsprotocol";
changelog = "https://github.com/microsoft/lsprotocol/releases/tag/${src.tag}";
-
license = licenses.mit;
-
maintainers = with maintainers; [
doronbehar
fab
];
···
jsonschema,
pyhamcrest,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "lsprotocol";
version = "2025.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "microsoft";
···
hash = "sha256-DrWXHMgDZSQQ6vsmorThMrUTX3UQU+DajSEOdxoXrFQ=";
};
+
sourceRoot = "${src.name}/packages/python";
build-system = [
flit-core
···
];
disabledTests = [
+
# cattrs.errors.StructureHandlerNotFoundError: Unsupported type:
+
# typing.Union[str, lsprotocol.types.NotebookDocumentFilter_Type1,
+
# lsprotocol.types.NotebookDocumentFilter_Type2,
+
# lsprotocol.types.NotebookDocumentFilter_Type3, NoneType]. Register
+
# a structure hook for it.
"test_notebook_sync_options"
];
preCheck = ''
+
cd ../../
'';
pythonImportsCheck = [ "lsprotocol" ];
+
meta = {
description = "Python implementation of the Language Server Protocol";
homepage = "https://github.com/microsoft/lsprotocol";
changelog = "https://github.com/microsoft/lsprotocol/releases/tag/${src.tag}";
+
license = lib.licenses.mit;
+
maintainers = with lib.maintainers; [
doronbehar
fab
];
+5 -1
pkgs/top-level/python-packages.nix
···
lsp-tree-sitter = callPackage ../development/python-modules/lsp-tree-sitter { };
-
lsprotocol = callPackage ../development/python-modules/lsprotocol { };
ltpycld2 = callPackage ../development/python-modules/ltpycld2 { };
···
lsp-tree-sitter = callPackage ../development/python-modules/lsp-tree-sitter { };
+
lsprotocol = lsprotocol_2023;
+
+
lsprotocol_2023 = callPackage ../development/python-modules/lsprotocol/2023.nix { };
+
+
lsprotocol_2025 = callPackage ../development/python-modules/lsprotocol/2025.nix { };
ltpycld2 = callPackage ../development/python-modules/ltpycld2 { };