Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, fetchFromGitHub 6, rustPlatform 7, pytestCheckHook 8, libiconv 9, numpy 10, protobuf 11, pyarrow 12, Security 13}: 14 15let 16 arrow-testing = fetchFromGitHub { 17 name = "arrow-testing"; 18 owner = "apache"; 19 repo = "arrow-testing"; 20 rev = "47f7b56b25683202c1fd957668e13f2abafc0f12"; 21 hash = "sha256-ZDznR+yi0hm5O1s9as8zq5nh1QxJ8kXCRwbNQlzXpnI="; 22 }; 23 24 parquet-testing = fetchFromGitHub { 25 name = "parquet-testing"; 26 owner = "apache"; 27 repo = "parquet-testing"; 28 rev = "b2e7cc755159196e3a068c8594f7acbaecfdaaac"; 29 hash = "sha256-IFvGTOkaRSNgZOj8DziRj88yH5JRF+wgSDZ5N0GNvjk="; 30 }; 31in 32 33buildPythonPackage rec { 34 pname = "datafusion"; 35 version = "23.0.0"; 36 format = "pyproject"; 37 38 src = fetchFromGitHub { 39 name = "datafusion-source"; 40 owner = "apache"; 41 repo = "arrow-datafusion-python"; 42 rev = "refs/tags/${version}"; 43 hash = "sha256-ndee7aNmoTtZyfl9UUXdNVHkp0GAuJWkyfZJyRrGwn8="; 44 }; 45 46 cargoDeps = rustPlatform.fetchCargoTarball { 47 name = "datafusion-cargo-deps"; 48 inherit src pname version; 49 hash = "sha256-eDweEc+7dDbF0WBi6M5XAPIiHRjlYAdf2eNJdwj4D7c="; 50 }; 51 52 nativeBuildInputs = with rustPlatform; [ 53 cargoSetupHook 54 maturinBuildHook 55 ]; 56 57 buildInputs = [ protobuf ] ++ lib.optionals stdenv.isDarwin [ libiconv Security ]; 58 59 propagatedBuildInputs = [ pyarrow ]; 60 61 nativeCheckInputs = [ pytestCheckHook numpy ]; 62 pythonImportsCheck = [ "datafusion" ]; 63 pytestFlagsArray = [ "--pyargs" pname ]; 64 65 preCheck = '' 66 pushd $TMPDIR 67 ln -s ${arrow-testing} ./testing 68 ln -s ${parquet-testing} ./parquet 69 ''; 70 71 postCheck = '' 72 popd 73 ''; 74 75 meta = with lib; { 76 description = "Extensible query execution framework"; 77 longDescription = '' 78 DataFusion is an extensible query execution framework, written in Rust, 79 that uses Apache Arrow as its in-memory format. 80 ''; 81 homepage = "https://arrow.apache.org/datafusion/"; 82 changelog = "https://github.com/apache/arrow-datafusion-python/blob/${version}/CHANGELOG.md"; 83 license = with licenses; [ asl20 ]; 84 maintainers = with maintainers; [ cpcloud ]; 85 }; 86}