diff --git a/pkgs/development/python-modules/pyarrow/default.nix b/pkgs/development/python-modules/pyarrow/default.nix index 51841a10d6fc..4c7777bce022 100644 --- a/pkgs/development/python-modules/pyarrow/default.nix +++ b/pkgs/development/python-modules/pyarrow/default.nix @@ -19,6 +19,7 @@ setuptools, setuptools-scm, oldest-supported-numpy, + tzdata, }: let @@ -116,8 +117,6 @@ buildPythonPackage rec { "pyarrow/tests/test_csv.py::TestThreadedCSVTableRead::test_cancellation" # expects arrow-cpp headers to be bundled. "pyarrow/tests/test_cpp_internals.py::test_pyarrow_include" - # Searches for TZDATA in /usr. - "pyarrow/tests/test_orc.py::test_example_using_json" # AssertionError: assert 'Europe/Monaco' == 'Europe/Paris' "pyarrow/tests/test_types.py::test_dateutil_tzinfo_to_string" # These fail with xxx_fixture not found. @@ -163,6 +162,13 @@ buildPythonPackage rec { disabledTests = [ "GcsFileSystem" ]; preCheck = '' + # Prepare r/w zoneinfo that test_orc can then copy and modify. + export TZDIR="$TMPDIR/zoneinfo" + cp -R "${tzdata}/${python.sitePackages}/tzdata/zoneinfo" "$TZDIR" + chmod -R u+w "$TZDIR" + substituteInPlace pyarrow/tests/test_orc.py \ + --replace-fail "Path('/usr/share/zoneinfo')" "Path('$TZDIR')" + export PARQUET_TEST_DATA="${arrow-cpp.env.PARQUET_TEST_DATA}" shopt -s extglob rm -r pyarrow/!(conftest.py|tests)