Fix mypy dependencies

This commit is contained in:
Nettika 2026-02-14 13:19:40 -08:00
parent 5f14fab320
commit cf19b5725f
No known key found for this signature in database
GPG key ID: C357EE70D5027BCC
5 changed files with 76 additions and 10 deletions

View file

@ -2,17 +2,24 @@
lib,
fetchFromGitHub,
python3,
# Injected dependencies
mypy-extensions,
typed-ast,
}:
python3.pkgs.buildPythonPackage rec {
# 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";
# This is the version oils-for-unix uses for mycpp Python-to-C++ translation
version = "0.780";
pyproject = true;
build-system = [ python3.pkgs.setuptools ];
src = fetchFromGitHub {
owner = "python";
repo = "mypy";
rev = "v${version}";
rev = "v${finalAttrs.version}";
# Fetch submodules to include typeshed (required for type stubs)
fetchSubmodules = true;
hash = "sha256-czwCx6ZjCu3CrVmbI6NbstzWM0GvuPTWJiiUhXSznu4=";
@ -27,14 +34,18 @@ python3.pkgs.buildPythonPackage rec {
# Skip tests to speed up build
doCheck = false;
dependencies = with python3.pkgs; [
# Skip runtime dependency check since we're using pinned older versions
pythonRuntimeDepsCheck = false;
dontCheckRuntimeDeps = true;
dependencies = [
mypy-extensions
typing-extensions
typed-ast
python3.pkgs.typing-extensions
];
# Ensure we're not pulling in a compiled version
pythonImportsCheck = [ "mypy" ];
meta.license = lib.licenses.mit;
}
})