poetry2nix/tests/mk-poetry-packages/default.nix
adisbladis 96d87dcbd5 Migrate from Niv to Flakes
It's annoying to have two incompatible version managers.
2023-07-14 19:21:55 +12:00

25 lines
862 B
Nix

/* It is assumed that propagated dependencies are included in the poetryPackages.
The "certifi" is direct dependency of "requests" library.
Note: this test assumes that "certifi" lib is going to be a dep of "requests" in the future.
*/
{ lib, poetry2nix, python3, python38 }:
let
inherit (builtins) elem map;
drvPythonCurrent = poetry2nix.mkPoetryPackages {
projectDir = ./.;
python = python3;
};
# Test backward compatibility
drvPythonOldest = poetry2nix.mkPoetryPackages {
projectDir = ./.;
python = python38;
};
packageNamesCurrent = map (package: package.pname) drvPythonCurrent.poetryPackages;
packageNamesPythonOldest = map (package: package.pname) drvPythonOldest.poetryPackages;
in
assert builtins.elem "certifi" packageNamesCurrent;
assert builtins.elem "certifi" packageNamesPythonOldest;
drvPythonCurrent.python