2021-03-04 20:20:03 +00:00
|
|
|
{ lib, stdenv, fetchPypi, buildPythonPackage, typed-ast, psutil, isPy3k
|
2019-10-24 08:56:26 +01:00
|
|
|
, mypy-extensions
|
|
|
|
, typing-extensions
|
|
|
|
}:
|
2018-05-25 10:42:34 +01:00
|
|
|
buildPythonPackage rec {
|
2017-05-11 21:33:34 +01:00
|
|
|
pname = "mypy";
|
2021-03-04 20:20:03 +00:00
|
|
|
version = "0.812";
|
2019-12-16 02:56:06 +00:00
|
|
|
disabled = !isPy3k;
|
2016-07-11 18:35:00 +01:00
|
|
|
|
2021-03-04 20:20:03 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "069i9qnfanp7dn8df1vspnqb0flvsszzn22v00vj08nzlnd061yd";
|
2016-07-11 18:35:00 +01:00
|
|
|
};
|
|
|
|
|
2019-10-24 08:56:26 +01:00
|
|
|
propagatedBuildInputs = [ typed-ast psutil mypy-extensions typing-extensions ];
|
2016-07-12 10:22:24 +01:00
|
|
|
|
2019-12-16 02:56:06 +00:00
|
|
|
# Tests not included in pip package.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"mypy"
|
|
|
|
"mypy.types"
|
|
|
|
"mypy.api"
|
|
|
|
"mypy.fastparse"
|
|
|
|
"mypy.report"
|
2020-11-30 13:38:55 +00:00
|
|
|
"mypyc"
|
|
|
|
"mypyc.analysis"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Compile mypy with mypyc, which makes mypy about 4 times faster. The compiled
|
|
|
|
# version is also the default in the wheels on Pypi that include binaries.
|
2020-12-30 08:04:15 +00:00
|
|
|
# is64bit: unfortunately the build would exhaust all possible memory on i686-linux.
|
|
|
|
MYPY_USE_MYPYC = stdenv.buildPlatform.is64bit;
|
2020-11-30 13:38:55 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-07-11 18:35:00 +01:00
|
|
|
description = "Optional static typing for Python";
|
|
|
|
homepage = "http://www.mypy-lang.org";
|
|
|
|
license = licenses.mit;
|
2017-05-11 21:33:34 +01:00
|
|
|
maintainers = with maintainers; [ martingms lnl7 ];
|
2016-07-11 18:35:00 +01:00
|
|
|
};
|
|
|
|
}
|