1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 cattrs,
6 fetchFromGitHub,
7 flit-core,
8 importlib-resources,
9 jsonschema,
10 pyhamcrest,
11 pytestCheckHook,
12 pythonOlder,
13}:
14
15buildPythonPackage rec {
16 pname = "lsprotocol";
17 version = "2025.0.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "microsoft";
24 repo = "lsprotocol";
25 tag = version;
26 hash = "sha256-DrWXHMgDZSQQ6vsmorThMrUTX3UQU+DajSEOdxoXrFQ=";
27 };
28
29 postPatch = ''
30 pushd packages/python
31 '';
32
33 build-system = [
34 flit-core
35 ];
36
37 dependencies = [
38 attrs
39 cattrs
40 ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 checkInputs = [
45 importlib-resources
46 jsonschema
47 pyhamcrest
48 ];
49
50 disabledTests = [
51 "test_notebook_sync_options"
52 ];
53
54 preCheck = ''
55 popd
56 '';
57
58 pythonImportsCheck = [ "lsprotocol" ];
59
60 meta = with lib; {
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 = licenses.mit;
65 maintainers = with maintainers; [
66 doronbehar
67 fab
68 ];
69 };
70}