2020-03-29 21:06:19 -07:00
|
|
|
{ lib, fetchpatch, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, futures, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkgconfig, setuptools_scm, six }:
|
2018-04-08 16:59:38 -07:00
|
|
|
|
|
|
|
let
|
2018-10-13 01:12:26 -07:00
|
|
|
_arrow-cpp = arrow-cpp.override { inherit python; };
|
2018-04-08 16:59:38 -07:00
|
|
|
in
|
2018-03-18 17:13:16 -07:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyarrow";
|
|
|
|
|
2018-10-03 15:37:12 -07:00
|
|
|
inherit (_arrow-cpp) version src;
|
2018-03-18 17:13:16 -07:00
|
|
|
|
2020-03-29 09:03:18 -07:00
|
|
|
patches = [
|
|
|
|
# Remove when updating pkgs.arrow-cpp to 0.17
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ARROW-8106-fix-conversion-test";
|
|
|
|
url = "https://github.com/apache/arrow/commit/af20bbff30adc560d7e57dd921345d00cc8b870c.patch";
|
|
|
|
sha256 = "0ihpw589vh35va31ajzy5zpx3bqd9gdn3342rghi03r245kch9zd";
|
|
|
|
stripLen = 1;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-03-18 17:13:16 -07:00
|
|
|
sourceRoot = "apache-arrow-${version}/python";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake cython pkgconfig setuptools_scm ];
|
2018-04-08 16:59:38 -07:00
|
|
|
propagatedBuildInputs = [ numpy six ] ++ lib.optionals (!isPy3k) [ futures ];
|
2020-03-29 21:06:19 -07:00
|
|
|
checkInputs = [ hypothesis pandas pytestCheckHook pytest-lazy-fixture ];
|
2018-03-18 17:13:16 -07:00
|
|
|
|
|
|
|
PYARROW_BUILD_TYPE = "release";
|
2019-03-25 21:05:59 -07:00
|
|
|
PYARROW_WITH_PARQUET = true;
|
2019-01-20 18:14:30 -08:00
|
|
|
PYARROW_CMAKE_OPTIONS = [
|
|
|
|
"-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib"
|
|
|
|
|
2019-01-29 13:19:02 -08:00
|
|
|
# This doesn't use setup hook to call cmake so we need to workaround #54606
|
|
|
|
# ourselves
|
|
|
|
"-DCMAKE_POLICY_DEFAULT_CMP0025=NEW"
|
2019-01-20 18:14:30 -08:00
|
|
|
];
|
2020-03-29 21:06:19 -07:00
|
|
|
ARROW_HOME = _arrow-cpp;
|
|
|
|
PARQUET_HOME = _arrow-cpp;
|
2018-03-18 17:13:16 -07:00
|
|
|
|
2019-09-13 10:24:26 -07:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2019-03-25 21:11:02 -07:00
|
|
|
preBuild = ''
|
|
|
|
export PYARROW_PARALLEL=$NIX_BUILD_CORES
|
|
|
|
'';
|
|
|
|
|
2020-03-29 21:06:19 -07:00
|
|
|
dontUseSetuptoolsCheck = true;
|
2018-03-18 17:13:16 -07:00
|
|
|
preCheck = ''
|
2018-10-25 19:18:18 -07:00
|
|
|
mv pyarrow/tests tests
|
|
|
|
rm -rf pyarrow
|
|
|
|
mkdir pyarrow
|
|
|
|
mv tests pyarrow/tests
|
|
|
|
'';
|
|
|
|
|
2018-03-18 17:13:16 -07:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A cross-language development platform for in-memory data";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://arrow.apache.org/";
|
2018-03-18 17:13:16 -07:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|