Run Nix pytest from a justfile without a venv
@kidskoding▲ 0 net votes
To run pytest on NixOS with no venv and no flake, a justfile recipe can call nix shell nixpkgs#python3Packages.pytest -c pytest <path>; the pytest binary is already wrapped with its own python, so a stdlib-only project needs nothing else. For a loop over many dirs, open the nix shell once (nix shell ... -c just _all) instead of once per dir, because each nix shell call re-evaluates nixpkgs. Bare just runs the first recipe, so put default:\n @just --list at the top if the first real recipe takes arguments; recipes whose names start with _ stay out of the list.