Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
pythonPackages.pyarrow: fix running tests on hydra
Browse files Browse the repository at this point in the history
This replaces standard checkPhase using setup.py that uses pytest-runner
with an explicit call to pytest. One reason to do that is because
setup.py triggers another rebuild when asked to do "test". Another
reason is that there seems to be a conflict between possible imports for
pyarrow: `pwd`/pyarrow vs $out/pyarrow. By some unknown reason this
triggers an import error on hydra and ofborg, but not on my machine. The
solution here is to remove `pwd`/pyarrow, keep the tests and use direct
call to pytest (setup.py needs `pwd`/pyarrow). The added benefit is that
we are now testing what is installed in $out.
  • Loading branch information
veprbl committed Oct 26, 2018
1 parent 2337c75 commit 6ae3cb4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkgs/development/python-modules/pyarrow/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, python, isPy3k, fetchurl, arrow-cpp, cmake, cython, futures, JPype1, numpy, pandas, pytest, pytestrunner, pkgconfig, setuptools_scm, six }:
{ lib, buildPythonPackage, python, isPy3k, fetchurl, arrow-cpp, cmake, cython, futures, JPype1, numpy, pandas, pytest, pkgconfig, setuptools_scm, six }:

let
_arrow-cpp = arrow-cpp.override { inherit python; };
Expand All @@ -13,7 +13,7 @@ buildPythonPackage rec {

nativeBuildInputs = [ cmake cython pkgconfig setuptools_scm ];
propagatedBuildInputs = [ numpy six ] ++ lib.optionals (!isPy3k) [ futures ];
checkInputs = [ pandas pytest pytestrunner JPype1 ];
checkInputs = [ pandas pytest JPype1 ];

PYARROW_BUILD_TYPE = "release";
PYARROW_CMAKE_OPTIONS = "-DCMAKE_INSTALL_RPATH=${ARROW_HOME}/lib";
Expand Down Expand Up @@ -43,6 +43,14 @@ buildPythonPackage rec {

setupPyBuildFlags = ["--with-parquet" ];

checkPhase = ''
mv pyarrow/tests tests
rm -rf pyarrow
mkdir pyarrow
mv tests pyarrow/tests
pytest -v
'';

meta = with lib; {
description = "A cross-language development platform for in-memory data";
homepage = https://arrow.apache.org/;
Expand Down

0 comments on commit 6ae3cb4

Please sign in to comment.