forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poetry-overrides.nix
126 lines (108 loc) · 4.25 KB
/
poetry-overrides.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
self: super:
let
inherit (self) pkgs;
inherit (pkgs) lib stdenv;
numpyVersion = super.numpy.version;
cythonVersion = super.cython.version;
pandasVersion = super.pandas.version;
parallelizeSetupPy = drv: drv.overridePythonAttrs (attrs: {
format = "setuptools";
enableParallelBuilding = true;
setupPyBuildFlags = attrs.setupPyBuildFlags or [ ] ++ [ "--parallel" "$NIX_BUILD_CORES" ];
});
versionBetween = version: lower: upper:
lib.versionAtLeast version lower && lib.versionOlder version upper;
customizeCython = (lib.versionAtLeast pandasVersion "1.4.4") && (lib.versionOlder cythonVersion "0.29.32");
in
{
cython = super.cython.overridePythonAttrs (
_: lib.optionalAttrs customizeCython rec {
version = "0.29.32";
src = self.fetchPypi {
pname = "Cython";
inherit version;
sha256 = "sha256-hzPPR1i3kwTypOOev6xekjQbzke8zrJsElQ5iy+MGvc=";
};
}
);
# this patch only applies to macos and only with numpy versions >=1.21,<1.21.2
# see https://github.com/numpy/numpy/issues/19624 for details
numpy = super.numpy.overridePythonAttrs (
attrs: lib.optionalAttrs
(stdenv.isDarwin && versionBetween numpyVersion "1.21.0" "1.21.2")
{
patches = attrs.patches or [ ] ++ [
(pkgs.fetchpatch {
url = "https://github.com/numpy/numpy/commit/8045183084042fbafc995dd26eb4d9ca45eb630e.patch";
sha256 = "14g69vq7llkh6smpfrb50iqga7fd360dkcc0rlwb5k2cz8bsii5b";
})
];
}
);
datafusion = super.datafusion.overridePythonAttrs (attrs: rec {
inherit (attrs) version;
src = pkgs.fetchFromGitHub {
owner = "datafusion-contrib";
repo = "datafusion-python";
rev = attrs.version;
sha256 = "sha256-9muPSFb4RjxP7X+qtUQ41rypgn0s9yWgmkyTA+edehU=";
};
patches = attrs.patches or [ ] ++ [
(pkgs.fetchpatch {
name = "optional-mimalloc.patch";
url = "https://github.com/datafusion-contrib/datafusion-python/commit/a5b10e8ef19514361fc6062a8ad63d7a793c2111.patch";
sha256 = "sha256-vmB1FKb2VeecrQt91J+pDp+2jvdtOrGd4w4wjhDMJK8=";
})
];
cargoBuildNoDefaultFeatures = stdenv.isDarwin;
nativeBuildInputs = attrs.nativeBuildInputs or [ ]
++ (with pkgs.rustPlatform; [ cargoSetupHook maturinBuildHook ]);
buildInputs = attrs.buildInputs or [ ]
++ lib.optionals stdenv.isDarwin [ pkgs.libiconv ];
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
inherit src patches;
sha256 = "sha256-rGXSmn3MF2wFyMqzF15gB9DK5f9W4Gk08J7tOsZ7IH0=";
};
});
pandas = parallelizeSetupPy super.pandas;
mkdocstrings = super.mkdocstrings.overridePythonAttrs (attrs: {
patches = attrs.patches or [ ] ++ [
(pkgs.fetchpatch {
name = "fix-jinja2-imports.patch";
url = "https://github.com/mkdocstrings/mkdocstrings/commit/b37722716b1e0ed6393ec71308dfb0f85e142f3b.patch";
sha256 = "sha256-DD1SjEvs5HBlSRLrqP3jhF/yoeWkF7F3VXCD1gyt5Fc=";
})
];
});
watchdog = super.watchdog.overrideAttrs (attrs: lib.optionalAttrs
(stdenv.isDarwin && lib.versionAtLeast attrs.version "2")
{
postPatch = ''
substituteInPlace setup.py \
--replace "if is_macos or os.getenv('FORCE_MACOS_MACHINE', '0') == '1':" 'if False:'
'';
});
idna = super.idna.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.flit-core ];
});
nbformat = super.nbformat.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.flit-core ];
});
termcolor = super.termcolor.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.hatch-vcs ];
});
untokenize = super.untokenize.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.poetry-core ];
});
docformatter = super.docformatter.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.poetry-core ];
});
pyarrow = super.pyarrow.overridePythonAttrs (_: {
PYARROW_WITH_DATASET = "1";
PYARROW_WITH_FLIGHT = "1";
PYARROW_WITH_HDFS = "0";
PYARROW_WITH_PARQUET = "1";
PYARROW_WITH_PLASMA = "0";
PYARROW_WITH_S3 = "${if pkgs.arrow-cpp.enableS3 then "1" else "0"}";
});
}