Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / datafusion / default.nix
blobbaf905f11fa71b451f503c648d5140282f5f2d1e
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
5 , rustPlatform
6 , pytestCheckHook
7 , libiconv
8 , numpy
9 , protobuf
10 , pyarrow
11 , Security
12 , SystemConfiguration
15 let
16   arrow-testing = fetchFromGitHub {
17     name = "arrow-testing";
18     owner = "apache";
19     repo = "arrow-testing";
20     rev = "5bab2f264a23f5af68f69ea93d24ef1e8e77fc88";
21     hash = "sha256-Pxx8ohUpXb5u1995IvXmxQMqWiDJ+7LAll/AjQP7ph8=";
22   };
24   parquet-testing = fetchFromGitHub {
25     name = "parquet-testing";
26     owner = "apache";
27     repo = "parquet-testing";
28     rev = "e13af117de7c4f0a4d9908ae3827b3ab119868f3";
29     hash = "sha256-rVI9zyk9IRDlKv4u8BeMb0HRdWLfCpqOlYCeUdA7BB8=";
30   };
33 buildPythonPackage rec {
34   pname = "datafusion";
35   version = "35.0.0";
36   format = "pyproject";
38   src = fetchFromGitHub {
39     name = "datafusion-source";
40     owner = "apache";
41     repo = "arrow-datafusion-python";
42     rev = "refs/tags/${version}";
43     hash = "sha256-43XY7j/8x+7SCY4W8nysaeWax2nvTTHZXMmy3hSz6pI=";
44   };
46   cargoDeps = rustPlatform.fetchCargoTarball {
47     name = "datafusion-cargo-deps";
48     inherit src pname version;
49     hash = "sha256-YWAyEMojw0bc/fu5kIZKMNPEgsAIpWqjVNodWXbgTl4=";
50   };
52   nativeBuildInputs = with rustPlatform; [
53     cargoSetupHook
54     maturinBuildHook
55   ];
57   buildInputs = [ protobuf ] ++ lib.optionals stdenv.isDarwin [
58     libiconv
59     Security
60     SystemConfiguration
61   ];
63   propagatedBuildInputs = [ pyarrow ];
65   nativeCheckInputs = [ pytestCheckHook numpy ];
66   pythonImportsCheck = [ "datafusion" ];
67   pytestFlagsArray = [ "--pyargs" pname ];
69   preCheck = ''
70     pushd $TMPDIR
71     ln -s ${arrow-testing} ./testing
72     ln -s ${parquet-testing} ./parquet
73   '';
75   postCheck = ''
76     popd
77   '';
79   meta = with lib; {
80     description = "Extensible query execution framework";
81     longDescription = ''
82       DataFusion is an extensible query execution framework, written in Rust,
83       that uses Apache Arrow as its in-memory format.
84     '';
85     homepage = "https://arrow.apache.org/datafusion/";
86     changelog = "https://github.com/apache/arrow-datafusion-python/blob/${version}/CHANGELOG.md";
87     license = with licenses; [ asl20 ];
88     maintainers = with maintainers; [ cpcloud ];
89   };