poetry2nix/tests/override-support/default.nix
Tobias Pflug b3870576f8 Provide withDefaults and withoutDefaults
This adds the convenience functions withDefaults and
withoutDefaults which simply wrap the provided argument in a list
either with or without the default poetry overrides.

Tests have also been adapted to make use of `withDefaults` where
appropriate.
2020-02-25 14:24:48 +01:00

25 lines
560 B
Nix

{ lib, python3, poetry2nix, runCommand }:
let
p = poetry2nix.mkPoetryApplication {
python = python3;
src = ./.;
poetrylock = ./poetry.lock;
pyproject = ./pyproject.toml;
overrides = poetry2nix.overrides.withDefaults
(
self: super: {
alembic = super.alembic.overrideAttrs (
old: {
TESTING_FOOBAR = 42;
}
);
}
);
};
in
runCommand "test" {} ''
x=${builtins.toString (p.python.pkgs.alembic.TESTING_FOOBAR)}
[ "$x" = "42" ] || exit 1
mkdir $out
''