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

52 lines
1.2 KiB
Nix
Raw Normal View History

{
lib,
fetchFromGitHub,
python3,
2026-02-14 13:19:40 -08:00
# Injected dependencies
mypy-extensions,
typed-ast,
}:
2026-02-14 13:19:40 -08:00
# mypy 0.780 is the last version with --py2 support
# Built without mypyc so mycpp can extend its classes
python3.pkgs.buildPythonPackage (finalAttrs: {
pname = "mypy";
version = "0.780";
2026-02-14 13:19:40 -08:00
pyproject = true;
build-system = [ python3.pkgs.setuptools ];
src = fetchFromGitHub {
owner = "python";
repo = "mypy";
2026-02-14 13:19:40 -08:00
rev = "v${finalAttrs.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;
2026-02-14 13:19:40 -08:00
# Skip runtime dependency check since we're using pinned older versions
pythonRuntimeDepsCheck = false;
dontCheckRuntimeDeps = true;
dependencies = [
mypy-extensions
typed-ast
2026-02-14 13:19:40 -08:00
python3.pkgs.typing-extensions
];
# Ensure we're not pulling in a compiled version
pythonImportsCheck = [ "mypy" ];
meta.license = lib.licenses.mit;
2026-02-14 13:19:40 -08:00
})