From 908a79be0ee047b6405e1546c90fa884bbcb3e02 Mon Sep 17 00:00:00 2001 From: DavHau Date: Thu, 20 Jul 2023 18:14:33 +0200 Subject: [PATCH] templates/python: add command `check` to run all checks --- templates/python-project/shell.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/python-project/shell.nix b/templates/python-project/shell.nix index 7432f8b8..92bd0d74 100644 --- a/templates/python-project/shell.nix +++ b/templates/python-project/shell.nix @@ -15,6 +15,9 @@ ps.pip ] ); + checkScript = pkgs.writeScriptBin "check" '' + nix build -f . tests.check -L "$@" + ''; devShell = pkgs.mkShell { packages = [ pkgs.ruff @@ -37,7 +40,7 @@ --editable $repo_root && \ cp -a pyproject.toml $tmp_path/pyproject.toml fi - export PATH="$tmp_path/bin:$PATH" + export PATH="$tmp_path/bin:${checkScript}/bin:$PATH" export PYTHONPATH="$repo_root:$tmp_path/${pythonWithDeps.sitePackages}" ''; };