1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 cattrs,
6 fetchFromGitHub,
7 flit-core,
8 importlib-resources,
9 jsonschema,
10 pyhamcrest,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "lsprotocol";
16 version = "2023.0.1";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "microsoft";
21 repo = "lsprotocol";
22 tag = version;
23 hash = "sha256-PHjLKazMaT6W4Lve1xNxm6hEwqE3Lr2m5L7Q03fqb68=";
24 };
25
26 sourceRoot = "${src.name}/packages/python";
27
28 build-system = [
29 flit-core
30 ];
31
32 dependencies = [
33 attrs
34 cattrs
35 ];
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 checkInputs = [
40 importlib-resources
41 jsonschema
42 pyhamcrest
43 ];
44
45 disabledTests = [
46 # cattrs.errors.StructureHandlerNotFoundError: Unsupported type:
47 # typing.Union[str, lsprotocol.types.NotebookDocumentFilter_Type1,
48 # lsprotocol.types.NotebookDocumentFilter_Type2,
49 # lsprotocol.types.NotebookDocumentFilter_Type3, NoneType]. Register
50 # a structure hook for it.
51 "test_notebook_sync_options"
52 ];
53
54 preCheck = ''
55 cd ../../
56 '';
57
58 pythonImportsCheck = [ "lsprotocol" ];
59
60 meta = {
61 description = "Python implementation of the Language Server Protocol";
62 homepage = "https://github.com/microsoft/lsprotocol";
63 changelog = "https://github.com/microsoft/lsprotocol/releases/tag/${src.tag}";
64 license = lib.licenses.mit;
65 maintainers = with lib.maintainers; [
66 doronbehar
67 fab
68 ];
69 };
70}