2019-01-21 03:14:30 +01:00
|
|
|
{ lib, buildPythonPackage, python, isPy3k, fetchurl, arrow-cpp, cmake, cython, futures, hypothesis, numpy, pandas, pytest, pkgconfig, setuptools_scm, six }:
|
2018-04-09 01:59:38 +02:00
|
|
|
|
|
|
|
let
|
2018-10-13 10:12:26 +02:00
|
|
|
_arrow-cpp = arrow-cpp.override { inherit python; };
|
2018-04-09 01:59:38 +02:00
|
|
|
in
|
2018-03-19 01:13:16 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyarrow";
|
|
|
|
|
2018-10-04 00:37:12 +02:00
|
|
|
inherit (_arrow-cpp) version src;
|
2018-03-19 01:13:16 +01:00
|
|
|
|
|
|
|
sourceRoot = "apache-arrow-${version}/python";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake cython pkgconfig setuptools_scm ];
|
2018-04-09 01:59:38 +02:00
|
|
|
propagatedBuildInputs = [ numpy six ] ++ lib.optionals (!isPy3k) [ futures ];
|
2019-01-21 03:14:30 +01:00
|
|
|
checkInputs = [ hypothesis pandas pytest ];
|
2018-03-19 01:13:16 +01:00
|
|
|
|
|
|
|
PYARROW_BUILD_TYPE = "release";
|
2019-01-21 03:14:30 +01:00
|
|
|
PYARROW_CMAKE_OPTIONS = [
|
|
|
|
"-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib"
|
|
|
|
|
|
|
|
# for some reason cmake won't set -std=c++11 for clang
|
|
|
|
"-DPYARROW_CXXFLAGS=-std=c++11"
|
|
|
|
];
|
2018-03-19 01:13:16 +01:00
|
|
|
|
|
|
|
preCheck = ''
|
2018-10-26 05:14:27 +02:00
|
|
|
rm pyarrow/tests/test_jvm.py
|
2018-03-19 01:13:16 +01:00
|
|
|
rm pyarrow/tests/test_hdfs.py
|
2018-10-13 10:12:26 +02:00
|
|
|
rm pyarrow/tests/test_cuda.py
|
2018-03-19 01:13:16 +01:00
|
|
|
|
|
|
|
# fails: "ArrowNotImplementedError: Unsupported numpy type 22"
|
|
|
|
substituteInPlace pyarrow/tests/test_feather.py --replace "test_timedelta_with_nulls" "_disabled"
|
|
|
|
|
|
|
|
# runs out of memory on @grahamcofborg linux box
|
|
|
|
substituteInPlace pyarrow/tests/test_feather.py --replace "test_large_dataframe" "_disabled"
|
|
|
|
|
|
|
|
# probably broken on python2
|
|
|
|
substituteInPlace pyarrow/tests/test_feather.py --replace "test_unicode_filename" "_disabled"
|
2018-04-04 20:35:47 +02:00
|
|
|
|
|
|
|
# fails "error: [Errno 2] No such file or directory: 'test'" because
|
|
|
|
# nix_run_setup invocation somehow manages to import deserialize_buffer.py
|
|
|
|
# when it is not intended to be imported at all
|
|
|
|
rm pyarrow/tests/deserialize_buffer.py
|
|
|
|
substituteInPlace pyarrow/tests/test_feather.py --replace "test_deserialize_buffer_in_different_process" "_disabled"
|
2018-03-19 01:13:16 +01:00
|
|
|
'';
|
|
|
|
|
2018-04-09 01:59:38 +02:00
|
|
|
ARROW_HOME = _arrow-cpp;
|
2018-10-13 10:12:26 +02:00
|
|
|
PARQUET_HOME = _arrow-cpp;
|
2018-03-20 23:19:39 +01:00
|
|
|
|
|
|
|
setupPyBuildFlags = ["--with-parquet" ];
|
2018-03-19 01:13:16 +01:00
|
|
|
|
2018-10-26 04:18:18 +02:00
|
|
|
checkPhase = ''
|
|
|
|
mv pyarrow/tests tests
|
|
|
|
rm -rf pyarrow
|
|
|
|
mkdir pyarrow
|
|
|
|
mv tests pyarrow/tests
|
|
|
|
pytest -v
|
|
|
|
'';
|
|
|
|
|
2018-03-19 01:13:16 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|