diff options
Diffstat (limited to 'Biz/Bild/Builder.nix')
-rw-r--r-- | Biz/Bild/Builder.nix | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Biz/Bild/Builder.nix b/Biz/Bild/Builder.nix index cf4d1e0..df5aeba 100644 --- a/Biz/Bild/Builder.nix +++ b/Biz/Bild/Builder.nix @@ -7,6 +7,15 @@ with bild; let analysis = builtins.fromJSON analysisJSON; + + # common bash functions for the builder + commonBash = builtins.toFile "common.bash" '' + # Check that a command succeeds, fail and log if not. + function check { + $@ || { echo "fail: $name: $3"; exit 1; } + } + ''; + build = _: target: let name = target.out; @@ -107,13 +116,12 @@ let python = python.buildPythonApplication rec { inherit name src CODEROOT; - propagatedBuildInputs = langdeps_ ++ sysdeps_; + nativeBuildInputs = [ makeWrapper ]; + propagatedBuildInputs = langdeps_ ++ sysdeps_ ++ rundeps_; buildInputs = sysdeps_; nativeCheckInputs = [ pkgs.ruff python.packages.mypy ]; checkPhase = '' - check() { - $@ || { echo "fail: $name: $3"; exit 1; } - } + . ${commonBash} cp ${../../pyproject.toml} ./pyproject.toml check ruff format --exclude 'setup.py' --check . check ruff check --exclude 'setup.py' --exclude '__init__.py' . @@ -123,6 +131,9 @@ let --no-error-summary \ --exclude 'setup\.py$' \ . + ''; + installCheck = '' + . ${commonBash} check python -m ${mainModule} test ''; preBuild = '' |