forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
86 lines (74 loc) · 1.92 KB
/
shell.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ python ? "3.10" }:
let
pkgs = import ./nix;
pythonEnv = pkgs."ibisDevEnv${pythonShortVersion}";
devDeps = with pkgs; [
# terminal markdown rendering
glow
# used in the justfile
jq
yj
# linting
commitlint
lychee
# packaging
niv
pythonEnv.pkgs.poetry
];
impalaUdfDeps = with pkgs; [
clang_12
cmake
ninja
];
backendTestDeps = [ pkgs.docker-compose ];
vizDeps = [ pkgs.graphviz-nox ];
duckdbDeps = [ pkgs.duckdb ];
mysqlDeps = [ pkgs.mariadb-client ];
pysparkDeps = [ pkgs.openjdk11_headless ];
postgresDeps = [ pkgs.postgresql ]; # postgres client dependencies
geospatialDeps = with pkgs; [ gdal_2 proj ];
sqliteDeps = [ pkgs.sqlite-interactive ];
libraryDevDeps = impalaUdfDeps
++ backendTestDeps
++ vizDeps
++ pysparkDeps
++ geospatialDeps
++ postgresDeps
++ sqliteDeps
++ duckdbDeps
++ mysqlDeps;
pythonShortVersion = builtins.replaceStrings [ "." ] [ "" ] python;
updateLockFiles = pkgs.writeShellApplication {
name = "update-lock-files";
runtimeInputs = [ pythonEnv.pkgs.poetry ];
text = ''
export PYTHONHASHSEED=42
poetry lock --no-update
poetry export --dev --without-hashes --no-ansi --extras all > requirements.txt
./dev/poetry2setup -o setup.py
'';
};
in
pkgs.mkShell {
name = "ibis${pythonShortVersion}";
shellHook = ''
export IBIS_TEST_DATA_DIRECTORY="$PWD/ci/ibis-testing-data"
rsync \
--chmod=Du+rwx,Fu+rw --archive --delete \
"${pkgs.ibisTestingData}/" \
"$IBIS_TEST_DATA_DIRECTORY"
export TEMPDIR
TEMPDIR="$(python -c 'import tempfile; print(tempfile.gettempdir())')"
'';
buildInputs = devDeps ++ libraryDevDeps ++ [
pythonEnv
updateLockFiles
] ++ pkgs.preCommitShell.buildInputs ++ (with pkgs; [
changelog
mic
rsync
]);
PYTHONPATH = builtins.toPath ./.;
PGPASSWORD = "postgres";
MYSQL_PWD = "ibis";
}