mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
python39Packages.mypy: 0.812 -> unstable-2021-11-14
Co-authored-by: @jnetod @veehaitch @nbraud @SuperSandro2000
This commit is contained in:
parent
8088701061
commit
8a976728e3
1 changed files with 45 additions and 13 deletions
|
@ -1,34 +1,63 @@
|
|||
{ lib, stdenv, fetchPypi, buildPythonPackage, typed-ast, psutil, isPy3k
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, buildPythonPackage
|
||||
, mypy-extensions
|
||||
, python
|
||||
, pythonOlder
|
||||
, typed-ast
|
||||
, typing-extensions
|
||||
, tomli
|
||||
, types-typed-ast
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "mypy";
|
||||
version = "0.812";
|
||||
disabled = !isPy3k;
|
||||
version = "unstable-2021-11-14";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "069i9qnfanp7dn8df1vspnqb0flvsszzn22v00vj08nzlnd061yd";
|
||||
src = fetchFromGitHub {
|
||||
owner = "python";
|
||||
repo = "mypy";
|
||||
rev = "053a1beb94ee4e5b3260725594315d1b6776e42f";
|
||||
sha256 = "sha256-q2ntj3y3GgXrw4v+yMvcqWFv4y/6YwunIj3bNzU9CH0=";
|
||||
};
|
||||
|
||||
# remove pin with mypy>=0.920
|
||||
patches = [
|
||||
# FIXME: Remove patch after upstream has decided the proper solution.
|
||||
# https://github.com/python/mypy/pull/11143
|
||||
(fetchpatch {
|
||||
url = "https://github.com/python/mypy/commit/f1755259d54330cd087cae763cd5bbbff26e3e8a.patch";
|
||||
sha256 = "sha256-5gPahX2X6+/qUaqDQIGJGvh9lQ2EDtks2cpQutgbOHk=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "typed_ast >= 1.4.0, < 1.5.0" "typed_ast >= 1.4.0, < 2"
|
||||
--replace "tomli>=1.1.0,<1.2.0" "tomli"
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [ typed-ast psutil mypy-extensions typing-extensions ];
|
||||
buildInputs = [
|
||||
types-typed-ast
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
mypy-extensions
|
||||
tomli
|
||||
typed-ast
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
# Tests not included in pip package.
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"mypy"
|
||||
"mypy.types"
|
||||
"mypy.api"
|
||||
"mypy.fastparse"
|
||||
"mypy.report"
|
||||
"mypy.types"
|
||||
"mypyc"
|
||||
"mypyc.analysis"
|
||||
];
|
||||
|
@ -38,10 +67,13 @@ buildPythonPackage rec {
|
|||
# is64bit: unfortunately the build would exhaust all possible memory on i686-linux.
|
||||
MYPY_USE_MYPYC = stdenv.buildPlatform.is64bit;
|
||||
|
||||
# when testing reduce optimisation level to drastically reduce build time
|
||||
MYPYC_OPT_LEVEL = 1;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Optional static typing for Python";
|
||||
homepage = "http://www.mypy-lang.org";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ martingms lnl7 ];
|
||||
homepage = "http://www.mypy-lang.org";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ martingms lnl7 SuperSandro2000 ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue