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