2018-04-09 00:59:38 +01:00
|
|
|
{ lib, buildPythonPackage, python, isPy3k, fetchurl, arrow-cpp, cmake, cython, futures, numpy, pandas, pytest, pytestrunner, parquet-cpp, pkgconfig, setuptools_scm, six }:
|
|
|
|
|
|
|
|
let
|
|
|
|
_arrow-cpp = arrow-cpp.override { inherit python;};
|
|
|
|
_parquet-cpp = parquet-cpp.override { arrow-cpp = _arrow-cpp; };
|
|
|
|
in
|
2018-03-19 00:13:16 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyarrow";
|
2018-04-04 19:35:47 +01:00
|
|
|
version = "0.9.0";
|
2018-03-19 00:13:16 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
|
2018-04-04 19:35:47 +01:00
|
|
|
sha256 = "16l91fixb5dgx3v6xc73ipn1w1hjgbmijyvs81j7ywzpna2cdcdy";
|
2018-03-19 00:13:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "apache-arrow-${version}/python";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake cython pkgconfig setuptools_scm ];
|
2018-04-09 00:59:38 +01:00
|
|
|
propagatedBuildInputs = [ numpy six ] ++ lib.optionals (!isPy3k) [ futures ];
|
2018-04-04 19:35:47 +01:00
|
|
|
checkInputs = [ pandas pytest pytestrunner ];
|
2018-03-19 00:13:16 +00:00
|
|
|
|
|
|
|
PYARROW_BUILD_TYPE = "release";
|
2018-03-20 22:19:39 +00:00
|
|
|
PYARROW_CMAKE_OPTIONS = "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib;${PARQUET_HOME}/lib";
|
2018-03-19 00:13:16 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
2018-03-20 22:19:39 +00:00
|
|
|
substituteInPlace CMakeLists.txt --replace "\''${ARROW_ABI_VERSION}" '"0.0.0"'
|
|
|
|
substituteInPlace CMakeLists.txt --replace "\''${ARROW_SO_VERSION}" '"0"'
|
|
|
|
|
|
|
|
# fix the hardcoded value
|
2018-04-09 00:59:38 +01:00
|
|
|
substituteInPlace cmake_modules/FindParquet.cmake --replace 'set(PARQUET_ABI_VERSION "1.0.0")' 'set(PARQUET_ABI_VERSION "${_parquet-cpp.version}")'
|
2018-03-19 00:13:16 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
rm pyarrow/tests/test_hdfs.py
|
|
|
|
|
|
|
|
# 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 19:35:47 +01: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 00:13:16 +00:00
|
|
|
'';
|
|
|
|
|
2018-04-09 00:59:38 +01:00
|
|
|
ARROW_HOME = _arrow-cpp;
|
|
|
|
PARQUET_HOME = _parquet-cpp;
|
2018-03-20 22:19:39 +00:00
|
|
|
|
|
|
|
setupPyBuildFlags = ["--with-parquet" ];
|
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 = lib.licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ veprbl ];
|
|
|
|
};
|
|
|
|
}
|