poetry2nix/tests/mk-poetry-packages/default.nix

26 lines
857 B
Nix
Raw Normal View History

2021-03-12 13:04:58 +01:00
/* It is assumed that propagated dependencies are included in the poetryPackages.
2021-12-25 16:00:20 -08:00
The "certifi" is direct dependency of "requests" library.
2021-03-12 13:04:58 +01:00
2021-12-25 16:00:20 -08:00
Note: this test assumes that "certifi" lib is going to be a dep of "requests" in the future.
2021-03-12 13:04:58 +01:00
*/
{ poetry2nix, python3, python39 }:
let
inherit (builtins) elem map;
drvPythonCurrent = poetry2nix.mkPoetryPackages {
projectDir = ./.;
python = python3;
};
# Test backward compatibility
drvPythonOldest = poetry2nix.mkPoetryPackages {
projectDir = ./.;
python = python39;
};
packageNamesCurrent = map (package: package.pname) drvPythonCurrent.poetryPackages;
packageNamesPythonOldest = map (package: package.pname) drvPythonOldest.poetryPackages;
2021-03-12 11:32:35 +01:00
in
assert builtins.elem "certifi" packageNamesCurrent;
assert builtins.elem "certifi" packageNamesPythonOldest;
drvPythonCurrent.python