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