-
Notifications
You must be signed in to change notification settings - Fork 4
/
default.nix
50 lines (39 loc) · 1023 Bytes
/
default.nix
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
pkgs ? import <nixpkgs> {}
, python ? pkgs.python3
}:
with python.pkgs;
buildPythonPackage {
pname = "finalfusion";
version = "0.7.0-git";
format = "pyproject";
src = pkgs.nix-gitignore.gitignoreSource [ ".git/" "*.nix" "result*" ] ./.;
nativeBuildInputs = [
cython
];
propagatedBuildInputs = [
numpy
toml
];
checkInputs = [
pytest
];
checkPhase = ''
pytest
patchShebangs tests/integration
export PATH=$PATH:$out/bin
tests/integration/all.sh
'';
# This is not necessary anymore in nixos-unstable and can be removed
# after nixpkgs/nixos 20.09 is released. (See nixpkgs#89607)
shellHook = ''
runHook preShellHook
tmp_path=$(mktemp -d)
export PATH="$tmp_path/bin:$PATH"
export PYTHONPATH="$tmp_path/${python.sitePackages}:$PYTHONPATH"
mkdir -p "$tmp_path/${python.sitePackages}"
${python.pythonForBuild.interpreter} -m pip install -e . \
--prefix "$tmp_path" --no-build-isolation >&2
runHook postShellHook
'';
}