forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
69 lines (53 loc) · 1.36 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ python ? "3.10"
, doCheck ? true
, backends ? [
"dask"
"datafusion"
"duckdb"
"pandas"
"sqlite"
]
}:
let
pkgs = import ./nix;
drv =
{ poetry2nix
, python
, lib
}:
let
buildInputs = with pkgs; [ gdal_2 graphviz-nox proj sqlite ];
checkInputs = buildInputs;
in
poetry2nix.mkPoetryApplication {
inherit python;
projectDir = ./.;
src = pkgs.gitignoreSource ./.;
overrides = pkgs.poetry2nix.overrides.withDefaults (
import ./poetry-overrides.nix
);
preConfigure = ''
rm setup.py
'';
inherit buildInputs checkInputs;
preCheck = ''
set -euo pipefail
tempdir="$(mktemp -d)"
cp -r ${pkgs.ibisTestingData}/* "$tempdir"
find "$tempdir" -type f -exec chmod u+rw {} +
find "$tempdir" -type d -exec chmod u+rwx {} +
ln -s "$tempdir" ci/ibis-testing-data
'';
checkPhase = ''
set -euo pipefail
runHook preCheck
pytest --numprocesses auto --dist loadgroup -m '${lib.concatStringsSep " or " backends} or core'
runHook postCheck
'';
inherit doCheck;
pythonImportsCheck = [ "ibis" ] ++ (map (backend: "ibis.backends.${backend}") backends);
};
in
pkgs.callPackage drv {
python = pkgs."python${builtins.replaceStrings [ "." ] [ "" ] python}";
}