forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poetry-overrides.nix
83 lines (73 loc) · 2.81 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
self: super:
let
inherit (self) pkgs;
inherit (pkgs) lib stdenv;
numpyVersion = self.numpy.version;
parallelizeSetupPy = drv: drv.overridePythonAttrs (attrs: {
format = "setuptools";
enableParallelBuilding = true;
setupPyBuildFlags = attrs.setupPyBuildFlags or [ ] ++ [ "--parallel" "$NIX_BUILD_CORES" ];
});
in
{
# see https://github.com/numpy/numpy/issues/19624 for details
numpy = super.numpy.overridePythonAttrs (attrs: {
patches = (attrs.patches or [ ])
++ lib.optional
# this patch only applies to macos and only with numpy versions >=1.21,<1.21.2
(stdenv.isDarwin && (lib.versionAtLeast numpyVersion "1.21.0" && lib.versionOlder numpyVersion "1.21.2"))
(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 = [
(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=";
};
});
tabulate = super.tabulate.overridePythonAttrs (_: {
TABULATE_INSTALL = "lib-only";
});
pandas = parallelizeSetupPy super.pandas;
pydantic = parallelizeSetupPy super.pydantic;
mkdocstrings-python-legacy = super.mkdocstrings-python-legacy.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ] ++ [ self.pdm-pep517 ];
});
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:'
'';
});
duckdb = super.duckdb.overrideAttrs (_: rec {
inherit (pkgs.duckdb) version src patches;
format = "setuptools";
preConfigure = ''
cd tools/pythonpkg
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
});
}