nixpkgs/pkgs/development/python-modules/pyarrow/default.nix

65 lines
2 KiB
Nix
Raw Normal View History

{ lib, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkg-config, setuptools-scm, six }:
2018-04-08 23:59:38 +00:00
let
2020-05-12 00:34:33 +00:00
_arrow-cpp = arrow-cpp.override { python3 = python; };
2018-04-08 23:59:38 +00:00
in
2018-03-19 00:13:16 +00:00
buildPythonPackage rec {
pname = "pyarrow";
2020-05-12 00:34:33 +00:00
disabled = !isPy3k;
2018-03-19 00:13:16 +00:00
inherit (_arrow-cpp) version src;
2018-03-19 00:13:16 +00:00
sourceRoot = "apache-arrow-${version}/python";
nativeBuildInputs = [ cmake cython pkg-config setuptools-scm ];
2020-05-12 00:34:33 +00:00
propagatedBuildInputs = [ numpy six ];
checkInputs = [ hypothesis pandas pytestCheckHook pytest-lazy-fixture ];
2018-03-19 00:13:16 +00:00
PYARROW_BUILD_TYPE = "release";
PYARROW_WITH_PARQUET = true;
PYARROW_CMAKE_OPTIONS = [
"-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib"
# This doesn't use setup hook to call cmake so we need to workaround #54606
# ourselves
"-DCMAKE_POLICY_DEFAULT_CMP0025=NEW"
];
ARROW_HOME = _arrow-cpp;
PARQUET_HOME = _arrow-cpp;
2018-03-19 00:13:16 +00:00
2019-09-13 17:24:26 +00:00
dontUseCmakeConfigure = true;
preBuild = ''
export PYARROW_PARALLEL=$NIX_BUILD_CORES
'';
pytestFlagsArray = [
# Deselect a single test because pyarrow prints a 2-line error message where
# only a single line is expected. The additional line of output comes from
# the glog library which is an optional dependency of arrow-cpp that is
# enabled in nixpkgs.
# Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393
"--deselect=pyarrow/tests/test_memory.py::test_env_var"
2021-07-29 19:30:34 +00:00
# Deselect a parquet dataset test because it erroneously fails to find the
# pyarrow._dataset module.
2021-07-29 19:30:34 +00:00
"--deselect=pyarrow/tests/parquet/test_dataset.py::test_parquet_dataset_deprecated_properties"
];
2021-01-26 16:35:44 +00:00
dontUseSetuptoolsCheck = true;
2018-03-19 00:13:16 +00:00
preCheck = ''
mv pyarrow/tests tests
rm -rf pyarrow
mkdir pyarrow
mv tests pyarrow/tests
'';
2018-03-19 00:13:16 +00:00
meta = with lib; {
description = "A cross-language development platform for in-memory data";
homepage = "https://arrow.apache.org/";
license = licenses.asl20;
2018-03-19 00:13:16 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ veprbl ];
2018-03-19 00:13:16 +00:00
};
}