Merge pull request #160465 from cpcloud/pyarrow-more-deps

python3Packages.pyarrow: enable more dependencies
This commit is contained in:
Dmitry Kalinkin 2022-02-19 18:11:32 -05:00 committed by GitHub
commit e2a45d97fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 14 deletions

View File

@ -162,6 +162,7 @@ stdenv.mkDerivation rec {
"-DARROW_ENGINE=ON" "-DARROW_ENGINE=ON"
"-DARROW_FILESYSTEM=ON" "-DARROW_FILESYSTEM=ON"
"-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}" "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}"
"-DARROW_HDFS=ON"
"-DARROW_IPC=ON" "-DARROW_IPC=ON"
"-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}" "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
"-DARROW_JSON=ON" "-DARROW_JSON=ON"

View File

@ -1,4 +1,24 @@
{ lib, stdenv, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkg-config, setuptools-scm, six }: { lib
, stdenv
, buildPythonPackage
, python
, isPy3k
, arrow-cpp
, cffi
, cloudpickle
, cmake
, cython
, fsspec
, hypothesis
, numpy
, pandas
, pytestCheckHook
, pytest-lazy-fixture
, pkg-config
, scipy
, setuptools-scm
, six
}:
let let
zero_or_one = cond: if cond then 1 else 0; zero_or_one = cond: if cond then 1 else 0;
@ -15,21 +35,23 @@ buildPythonPackage rec {
sourceRoot = "apache-arrow-${version}/python"; sourceRoot = "apache-arrow-${version}/python";
nativeBuildInputs = [ cmake cython pkg-config setuptools-scm ]; nativeBuildInputs = [ cmake cython pkg-config setuptools-scm ];
propagatedBuildInputs = [ numpy six ]; propagatedBuildInputs = [ numpy six cloudpickle scipy fsspec cffi ];
checkInputs = [ hypothesis pandas pytestCheckHook pytest-lazy-fixture ]; checkInputs = [
hypothesis
pandas
pytestCheckHook
pytest-lazy-fixture
];
PYARROW_BUILD_TYPE = "release"; PYARROW_BUILD_TYPE = "release";
PYARROW_WITH_DATASET = zero_or_one true; PYARROW_WITH_DATASET = zero_or_one true;
PYARROW_WITH_FLIGHT = zero_or_one _arrow-cpp.enableFlight; PYARROW_WITH_FLIGHT = zero_or_one _arrow-cpp.enableFlight;
PYARROW_WITH_PARQUET = zero_or_one true; PYARROW_WITH_PARQUET = zero_or_one true;
PYARROW_WITH_HDFS = zero_or_one true;
PYARROW_CMAKE_OPTIONS = [ PYARROW_CMAKE_OPTIONS = [
"-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib" "-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; ARROW_HOME = _arrow-cpp;
@ -51,9 +73,6 @@ buildPythonPackage rec {
# enabled in nixpkgs. # enabled in nixpkgs.
# Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393 # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393
"--deselect=pyarrow/tests/test_memory.py::test_env_var" "--deselect=pyarrow/tests/test_memory.py::test_env_var"
# Deselect a parquet dataset test because it erroneously fails to find the
# pyarrow._dataset module.
"--deselect=pyarrow/tests/parquet/test_dataset.py::test_parquet_dataset_deprecated_properties"
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
# Requires loopback networking # Requires loopback networking
"--deselect=pyarrow/tests/test_ipc.py::test_socket_" "--deselect=pyarrow/tests/test_ipc.py::test_socket_"
@ -61,12 +80,21 @@ buildPythonPackage rec {
dontUseSetuptoolsCheck = true; dontUseSetuptoolsCheck = true;
preCheck = '' preCheck = ''
mv pyarrow/tests tests shopt -s extglob
rm -rf pyarrow rm -r pyarrow/!(tests)
mkdir pyarrow
mv tests pyarrow/tests
''; '';
pythonImportsCheck = map (module: "pyarrow.${module}") [
"compute"
"csv"
"dataset"
"flight"
"fs"
"hdfs"
"json"
"parquet"
];
meta = with lib; { meta = with lib; {
description = "A cross-language development platform for in-memory data"; description = "A cross-language development platform for in-memory data";
homepage = "https://arrow.apache.org/"; homepage = "https://arrow.apache.org/";