Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, buildPythonPackage, python, isPy3k, arrow-cpp, cmake, cython, hypothesis, numpy, pandas, pytestCheckHook, pytest-lazy-fixture, pkg-config, setuptools-scm, six }:
2
3let
4 _arrow-cpp = arrow-cpp.override { python3 = python; };
5in
6
7buildPythonPackage rec {
8 pname = "pyarrow";
9 disabled = !isPy3k;
10
11 inherit (_arrow-cpp) version src;
12
13 sourceRoot = "apache-arrow-${version}/python";
14
15 nativeBuildInputs = [ cmake cython pkg-config setuptools-scm ];
16 propagatedBuildInputs = [ numpy six ];
17 checkInputs = [ hypothesis pandas pytestCheckHook pytest-lazy-fixture ];
18
19 PYARROW_BUILD_TYPE = "release";
20 PYARROW_WITH_PARQUET = true;
21 PYARROW_CMAKE_OPTIONS = [
22 "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib"
23
24 # This doesn't use setup hook to call cmake so we need to workaround #54606
25 # ourselves
26 "-DCMAKE_POLICY_DEFAULT_CMP0025=NEW"
27 ];
28 ARROW_HOME = _arrow-cpp;
29 PARQUET_HOME = _arrow-cpp;
30
31 dontUseCmakeConfigure = true;
32
33 preBuild = ''
34 export PYARROW_PARALLEL=$NIX_BUILD_CORES
35 '';
36
37 pytestFlagsArray = [
38 # Deselect a single test because pyarrow prints a 2-line error message where
39 # only a single line is expected. The additional line of output comes from
40 # the glog library which is an optional dependency of arrow-cpp that is
41 # enabled in nixpkgs.
42 # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393
43 "--deselect=pyarrow/tests/test_memory.py::test_env_var"
44 # Deselect a parquet dataset test because it erroneously fails to find the
45 # pyarrow._dataset module.
46 "--deselect=pyarrow/tests/parquet/test_dataset.py::test_parquet_dataset_deprecated_properties"
47 ] ++ lib.optionals stdenv.isDarwin [
48 # Requires loopback networking
49 "--deselect=pyarrow/tests/test_ipc.py::test_socket_"
50 ];
51
52 dontUseSetuptoolsCheck = true;
53 preCheck = ''
54 mv pyarrow/tests tests
55 rm -rf pyarrow
56 mkdir pyarrow
57 mv tests pyarrow/tests
58 '';
59
60 meta = with lib; {
61 description = "A cross-language development platform for in-memory data";
62 homepage = "https://arrow.apache.org/";
63 license = licenses.asl20;
64 platforms = platforms.unix;
65 maintainers = with maintainers; [ veprbl ];
66 };
67}