1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 cattrs,
6 fetchFromGitHub,
7 flit-core,
8 importlib-resources,
9 jsonschema,
10 nox,
11 pyhamcrest,
12 pytest,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "lsprotocol";
18 version = "2023.0.1";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "microsoft";
25 repo = "lsprotocol";
26 rev = "refs/tags/${version}";
27 hash = "sha256-PHjLKazMaT6W4Lve1xNxm6hEwqE3Lr2m5L7Q03fqb68=";
28 };
29
30 nativeBuildInputs = [
31 flit-core
32 nox
33 ];
34
35 propagatedBuildInputs = [
36 attrs
37 cattrs
38 ];
39
40 nativeCheckInputs = [ pytest ];
41
42 checkInputs = [
43 importlib-resources
44 jsonschema
45 pyhamcrest
46 ];
47
48 preBuild = ''
49 cd packages/python
50 '';
51
52 preCheck = ''
53 cd ../../
54 '';
55
56 checkPhase = ''
57 runHook preCheck
58
59 sed -i "/^ _install_requirements/d" noxfile.py
60 nox --session tests
61
62 runHook postCheck
63 '';
64
65 pythonImportsCheck = [ "lsprotocol" ];
66
67 meta = with lib; {
68 description = "Python implementation of the Language Server Protocol";
69 homepage = "https://github.com/microsoft/lsprotocol";
70 changelog = "https://github.com/microsoft/lsprotocol/releases/tag/${version}";
71 license = licenses.mit;
72 maintainers = with maintainers; [
73 doronbehar
74 fab
75 ];
76 };
77}