2021-02-17 17:02:09 +00:00
|
|
|
{ lib, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkg-config, setuptools_scm, six }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-05-29 06:06:01 +00:00
|
|
|
_arrow-cpp = arrow-cpp.override { python3 = python; };
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyarrow";
|
2020-05-29 06:06:01 +00:00
|
|
|
disabled = !isPy3k;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit (_arrow-cpp) version src;
|
|
|
|
|
|
|
|
sourceRoot = "apache-arrow-${version}/python";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake cython pkg-config setuptools_scm ];
|
2020-05-29 06:06:01 +00:00
|
|
|
propagatedBuildInputs = [ numpy six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [ hypothesis pandas pytestCheckHook pytest-lazy-fixture ];
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PYARROW_PARALLEL=$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# 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
|
|
|
|
pytestFlagsArray = [ "--deselect=pyarrow/tests/test_memory.py::test_env_var" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
dontUseSetuptoolsCheck = true;
|
|
|
|
preCheck = ''
|
|
|
|
mv pyarrow/tests tests
|
|
|
|
rm -rf pyarrow
|
|
|
|
mkdir pyarrow
|
|
|
|
mv tests pyarrow/tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A cross-language development platform for in-memory data";
|
|
|
|
homepage = "https://arrow.apache.org/";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|