1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 typing,
6 pytestCheckHook,
7 pythonAtLeast,
8 pythonOlder,
9}:
10
11buildPythonPackage rec {
12 pname = "mypy-extensions";
13 version = "1.0.0";
14
15 src = fetchFromGitHub {
16 owner = "python";
17 repo = "mypy_extensions";
18 rev = version;
19 hash = "sha256-gOfHC6dUeBE7SsWItpUHHIxW3wzhPM5SuGW1U8P7DD0=";
20 };
21
22 propagatedBuildInputs = lib.optional (pythonOlder "3.5") typing;
23
24 # make the testsuite run with pytest, so we can disable individual tests
25 nativeCheckInputs = [ pytestCheckHook ];
26
27 pytestFlagsArray = [ "tests/testextensions.py" ];
28
29 disabledTests = lib.optionals (pythonAtLeast "3.11") [
30 # https://github.com/python/mypy_extensions/issues/24
31 "test_typeddict_errors"
32 ];
33
34 pythonImportsCheck = [ "mypy_extensions" ];
35
36 meta = with lib; {
37 description = "Experimental type system extensions for programs checked with the mypy typechecker";
38 homepage = "https://www.mypy-lang.org";
39 license = licenses.mit;
40 maintainers = with maintainers; [ lnl7 ];
41 };
42}