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