about summary refs log tree commit diff
path: root/pkgs/development/python-modules/mypy/extensions.nix
blob: e8622b84eb7c9ede4e62aa2273f6222fa6c433f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, fetchFromGitHub
, buildPythonPackage
, typing
, pytestCheckHook
, pythonAtLeast
, pythonOlder
}:

buildPythonPackage rec {
  pname = "mypy-extensions";
  version = "1.0.0";

  src = fetchFromGitHub {
    owner = "python";
    repo = "mypy_extensions";
    rev = version;
    hash = "sha256-gOfHC6dUeBE7SsWItpUHHIxW3wzhPM5SuGW1U8P7DD0=";
  };

  propagatedBuildInputs = lib.optional (pythonOlder "3.5") typing;

  # make the testsuite run with pytest, so we can disable individual tests
  nativeCheckInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "tests/testextensions.py"
  ];

  disabledTests = lib.optionals (pythonAtLeast "3.11") [
    # https://github.com/python/mypy_extensions/issues/24
    "test_typeddict_errors"
  ];

  pythonImportsCheck = [
    "mypy_extensions"
  ];

  meta = with lib; {
    description = "Experimental type system extensions for programs checked with the mypy typechecker";
    homepage = "https://www.mypy-lang.org";
    license = licenses.mit;
    maintainers = with maintainers; [ lnl7 ];
  };
}