Add mypy to python flake
This commit is contained in:
parent
51acaa3904
commit
60d813c804
1
python/.gitignore
vendored
1
python/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
.direnv
|
||||
.mypy_cache
|
||||
|
|
|
@ -9,11 +9,16 @@
|
|||
flake-utils.lib.eachDefaultSystem (sys:
|
||||
let pkgs = nixpkgs.legacyPackages.${sys};
|
||||
python = pkgs.python310.withPackages (ps: with ps; [
|
||||
matplotlib
|
||||
ipython
|
||||
pylsp-mypy
|
||||
]);
|
||||
cfg = ./mypy-config.ini;
|
||||
in rec {
|
||||
devShells.default = python;
|
||||
packages.tychk-watch = pkgs.writeScriptBin "tychk" "echo 'running mypy on change...' ; ${pkgs.watchexec}/bin/watchexec -e py ${python}/bin/mypy --config ${cfg} ${./.}";
|
||||
packages.tychk = pkgs.writeScriptBin "tychk" "${python}/bin/mypy ${./.} --config ${cfg}";
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ python ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
5
python/mypy-config.ini
Normal file
5
python/mypy-config.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
[mypy]
|
||||
disallow_untyped_defs = True
|
||||
disallow_incomplete_defs = True
|
||||
check_untyped_defs = True
|
||||
|
Loading…
Reference in New Issue
Block a user