1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, setuptools
6, mypy
7, pytestCheckHook
8, python-lsp-server
9, pythonOlder
10, tomli
11}:
12
13buildPythonPackage rec {
14 pname = "pylsp-mypy";
15 version = "0.6.7";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "python-lsp";
22 repo = "pylsp-mypy";
23 rev = "refs/tags/${version}";
24 hash = "sha256-ZsNIw0xjxnU9Ue0C7TlhzVOCOCKEbCa2CsiiqeMb14I=";
25 };
26
27 patches = [
28 # https://github.com/python-lsp/pylsp-mypy/pull/64
29 (fetchpatch {
30 name = "fix-hanging-test.patch";
31 url = "https://github.com/python-lsp/pylsp-mypy/commit/90d28edb474135007804f1e041f88713a95736f9.patch";
32 hash = "sha256-3DVyUXVImRemXCuyoXlYbPJm6p8OnhBdEKmwjx88ets=";
33 })
34 ];
35
36 nativeBuildInputs = [
37 setuptools
38 ];
39
40 propagatedBuildInputs = [
41 mypy
42 python-lsp-server
43 ] ++ lib.optionals (pythonOlder "3.11") [
44 tomli
45 ];
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [
52 "pylsp_mypy"
53 ];
54
55 disabledTests = [
56 # Tests wants to call dmypy
57 "test_option_overrides_dmypy"
58 ];
59
60 meta = with lib; {
61 description = "Mypy plugin for the Python LSP Server";
62 homepage = "https://github.com/python-lsp/pylsp-mypy";
63 license = licenses.mit;
64 maintainers = with maintainers; [ cpcloud ];
65 };
66}