1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7
8 # build-system
9 poetry-core,
10
11 # dependencies
12 docstring-to-markdown,
13 jedi,
14 lsprotocol,
15 pydantic,
16 pygls,
17
18 # tests
19 pytestCheckHook,
20 pyhamcrest,
21 python-lsp-jsonrpc,
22}:
23
24buildPythonPackage rec {
25 pname = "jedi-language-server";
26 version = "0.45.1";
27 pyproject = true;
28
29 disabled = pythonOlder "3.9";
30
31 src = fetchFromGitHub {
32 owner = "pappasam";
33 repo = "jedi-language-server";
34 tag = "v${version}";
35 hash = "sha256-uO7+ui9FEeMF4sC/jI91px5wEWecvfJApogFMfwpPEs=";
36 };
37
38 build-system = [
39 poetry-core
40 ];
41
42 dependencies = [
43 docstring-to-markdown
44 jedi
45 lsprotocol
46 pydantic
47 pygls
48 ];
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 pyhamcrest
53 python-lsp-jsonrpc
54 ];
55
56 preCheck = ''
57 HOME="$(mktemp -d)"
58 '';
59
60 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
61 # https://github.com/pappasam/jedi-language-server/issues/313
62 "test_publish_diagnostics_on_change"
63 "test_publish_diagnostics_on_save"
64 ];
65
66 pythonImportsCheck = [ "jedi_language_server" ];
67
68 meta = {
69 description = "Language Server for the latest version(s) of Jedi";
70 mainProgram = "jedi-language-server";
71 homepage = "https://github.com/pappasam/jedi-language-server";
72 changelog = "https://github.com/pappasam/jedi-language-server/blob/${src.tag}/CHANGELOG.md";
73 license = lib.licenses.mit;
74 maintainers = with lib.maintainers; [ doronbehar ];
75 };
76}