mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-06 09:41:39 -05:00
21 lines
706 B
Nix
21 lines
706 B
Nix
{ poetry2nix, python3, runCommand }:
|
|
let
|
|
env-wheel = poetry2nix.mkPoetryEnv {
|
|
python = python3;
|
|
pyproject = ./pyproject.toml;
|
|
poetrylock = ./poetry.lock;
|
|
preferWheels = true;
|
|
};
|
|
env-no-wheel = poetry2nix.mkPoetryEnv {
|
|
python = python3;
|
|
pyproject = ./pyproject.toml;
|
|
poetrylock = ./poetry.lock;
|
|
preferWheels = false;
|
|
};
|
|
isWheel = env-wheel.python.pkgs.colour.src.isWheel or false;
|
|
isNotWheel = env-no-wheel.python.pkgs.colour.src.isWheel or false;
|
|
in
|
|
assert isWheel; assert !isNotWheel; runCommand "colour-test" { } ''
|
|
${env-wheel}/bin/python -c 'import colour; print("wheel")' > $out
|
|
${env-no-wheel}/bin/python -c 'import colour; print("source")' >> $out
|
|
''
|