oils-for-unix-from-source/mypy-0.780.nix

40 lines
885 B
Nix

{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonPackage rec {
pname = "mypy";
# This is the version oils-for-unix uses for mycpp Python-to-C++ translation
version = "0.780";
src = fetchFromGitHub {
owner = "python";
repo = "mypy";
rev = "v${version}";
# Fetch submodules to include typeshed (required for type stubs)
fetchSubmodules = true;
hash = "sha256-czwCx6ZjCu3CrVmbI6NbstzWM0GvuPTWJiiUhXSznu4=";
};
# Do not use mypyc to compile.
# Rather, build interpreted so mycpp can extend its classes.
preBuild = ''
export MYPY_USE_MYPYC=0
'';
# Skip tests to speed up build
doCheck = false;
dependencies = with python3.pkgs; [
mypy-extensions
typing-extensions
typed-ast
];
# Ensure we're not pulling in a compiled version
pythonImportsCheck = [ "mypy" ];
meta.license = lib.licenses.mit;
}