From 7d7e0c02351303489d5555627337a39b519b536a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 16 Aug 2023 14:18:10 -0400 Subject: Get python targets building I added 'black' to Biz/Lint.hs, but not the others because they rely on dependencies being in the PYTHONPATH to work, so they are only relevant in nix builds and repls. I also made some other tweaks to the python checkPhase and linted all the files. Everything should be building and linting correctly now. --- Biz/Bild/Builder.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Biz/Bild/Builder.nix') diff --git a/Biz/Bild/Builder.nix b/Biz/Bild/Builder.nix index 214c110..2b1403a 100644 --- a/Biz/Bild/Builder.nix +++ b/Biz/Bild/Builder.nix @@ -59,10 +59,13 @@ in { buildInputs = sysdeps_; checkInputs = [(private.pythonWith (p: with p; [black mypy pylint]))]; checkPhase = '' - black --quiet --exclude 'setup\.py$' --check . - pylint --errors-only . - mypy --strict --no-error-summary --exclude 'setup\.py$' . - python -m ${main} test + check() { + $@ || { echo "fail: $name: $3"; exit 1; } + } + check python -m black --quiet --exclude 'setup\.py$' --check . + check python -m pylint --errors-only . + check python -m mypy --strict --no-error-summary --exclude 'setup\.py$' . + check python -m ${main} test ''; preBuild = '' # initialize possibly-empty subdirectories as python modules -- cgit v1.2.3