-
-
Notifications
You must be signed in to change notification settings - Fork 459
Expand file tree
/
Copy pathdefault.nix
More file actions
25 lines (24 loc) · 644 Bytes
/
default.nix
File metadata and controls
25 lines (24 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ poetry2nix, python3, runCommand }:
let
env = poetry2nix.mkPoetryEnv {
python = python3;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
editablePackageSources = {
# Usually this would be trivial = ./src
# But we use this here to be able to test it
# in a derivation build
trivial = "/build/src";
};
};
in
runCommand "editable-test"
{ } ''
cp -r --no-preserve=mode ${./src} src
echo 'print("Changed")' > src/trivial/__main__.py
if [[ $(${env}/bin/python -m trivial) != "Changed" ]]; then
echo "Package wasn't editable!"
exit 1
fi
touch $out
'' // { inherit env; }