mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 11:36:11 +01:00
Switch to bats over pytest
This removes python entirely from the stack. Yet to run the tests on macOS, but they're buildable by way of nix wrapping. Worst case scenario, you cannot run them from the devshell but `nix run .#test-runner-<latest||stable>` should work okay.
This commit is contained in:
parent
445dc9ffc6
commit
c59b60e747
23 changed files with 344 additions and 385 deletions
36
shell.nix
36
shell.nix
|
|
@ -1,14 +1,30 @@
|
|||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
packages ? [ ],
|
||||
treefmt ? null,
|
||||
nix-direnv ? (pkgs.callPackage ./default.nix { }),
|
||||
test_pkgs ? (pkgs.lib.callPackagesWith pkgs ./tests { inherit nix-direnv; }),
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
mkShell {
|
||||
packages = packages ++ [
|
||||
python3.pkgs.pytest
|
||||
python3.pkgs.mypy
|
||||
ruff
|
||||
direnv
|
||||
];
|
||||
let
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
DIRENV_STDLIB = "${test_pkgs.direnv-stdlib}";
|
||||
DIRENVRC = "${nix-direnv}/share/nix-direnv/direnvrc";
|
||||
BATS_LIB_PATH = lib.strings.makeSearchPath "" (
|
||||
with test_pkgs;
|
||||
[
|
||||
bats-support
|
||||
bats-assert
|
||||
]
|
||||
);
|
||||
packages =
|
||||
(builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
bats
|
||||
direnv
|
||||
shellcheck
|
||||
;
|
||||
})
|
||||
++ (builtins.attrValues (lib.attrsets.filterAttrs (name: _val: name != "direnv-stdlib") test_pkgs))
|
||||
++ lib.optionals (treefmt != null) [ treefmt ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue