···5, fetchPypi
6, fetchFromGitHub
7, rustPlatform
8-, maturin
9, pytestCheckHook
10, libiconv
11, numpy
12, pandas
13, pyarrow
14-, pytest
15}:
016let
17- # le sigh, the perils of unrelated versions of software living in the same
18- # repo: there's no obvious way to map the top level source repo
19- # (arrow-datafusion) version to the version of contained repo
20- # (arrow-datafusion/python)
21- #
22- # A commit hash will do in a pinch, and ultimately the sha256 has the final
23- # say of what the content is when building
24- cargoLock = fetchurl {
25- url = "https://raw.githubusercontent.com/apache/arrow-datafusion/6.0.0/python/Cargo.lock";
26- sha256 = "sha256-xiv3drEU5jOGsEIh0U01ZQ1NBKobxO2ctp4mxy9iigw=";
27 };
2829- postUnpack = ''
30- cp "${cargoLock}" $sourceRoot/Cargo.lock
31- chmod u+w $sourceRoot/Cargo.lock
32- '';
0033in
034buildPythonPackage rec {
35 pname = "datafusion";
36- version = "0.4.0";
37 format = "pyproject";
3839 src = fetchPypi {
40 inherit pname version;
41- sha256 = "sha256-+YqogteKfNhtI2QbVXv/5CIWm3PcOH653dwONm5ZcL8=";
42 };
4344- inherit postUnpack;
45-46- # TODO: remove the patch hacking and postUnpack hooks after
47- # https://github.com/apache/arrow-datafusion/pull/1508 is merged
48- #
49- # the lock file isn't up to date as of 6.0.0 so we need to patch the source
50- # lockfile and the vendored cargo deps lockfile
51- patches = [ ./Cargo.lock.patch ];
52 cargoDeps = rustPlatform.fetchCargoTarball {
53- inherit src pname version postUnpack;
54- sha256 = "sha256-JGyDxpfBXzduJaMF1sbmRm7KJajHYdVSj+WbiSETiY0=";
55- patches = [ ./Cargo.lock.patch ];
56 };
5758 nativeBuildInputs = with rustPlatform; [
···68 pyarrow
69 ];
7071- nativeCheckInputs = [ pytest ];
72 pythonImportsCheck = [ "datafusion" ];
07374- checkPhase = ''
75- runHook preCheck
76- pytest --pyargs "${pname}"
77- runHook postCheck
000078 '';
7980 meta = with lib; {