30 buildPythonPackage rec {
35 inherit pname version;
36 sha256 = "18imlm8xbhcbwy4wa957a1fkamrcb0z988z006jpfda3ki09z4ag";
39 checkInputs = [ pytest glibcLocales moto hypothesis ];
41 nativeBuildInputs = [ cython ];
42 buildInputs = lib.optional stdenv.isDarwin libcxx;
43 propagatedBuildInputs = [
59 # For OSX, we need to add a dependency on libcxx, which provides
60 # `complex.h` and other libraries that pandas depends on to build.
61 postPatch = lib.optionalString stdenv.isDarwin ''
62 cpp_sdk="${libcxx}/include/c++/v1";
63 echo "Adding $cpp_sdk to the setup.py common_include variable"
64 substituteInPlace setup.py \
65 --replace "['pandas/src/klib', 'pandas/src']" \
66 "['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
70 disabledTests = lib.concatMapStringsSep " and " (s: "not " + s) ([
71 # since dateutil 0.6.0 the following fails: test_fallback_plural, test_ambiguous_flags, test_ambiguous_compat
72 # was supposed to be solved by https://github.com/dateutil/dateutil/issues/321, but is not the case
73 "test_fallback_plural"
74 "test_ambiguous_flags"
75 "test_ambiguous_compat"
78 "test_dt_accessor_datetime_name_accessors"
79 "test_datetime_name_accessors"
80 # Can't import from test folder
82 # Disable IO related tests because IO data is no longer distributed
86 ] ++ lib.optionals stdenv.isDarwin [
91 doCheck = !stdenv.isAarch64; # upstream doesn't test this architecture
96 # TODO: Get locale and clipboard support working on darwin.
97 # Until then we disable the tests.
98 + lib.optionalString stdenv.isDarwin ''
99 # Fake the impure dependencies pbpaste and pbcopy
100 echo "#!${runtimeShell}" > pbcopy
101 echo "#!${runtimeShell}" > pbpaste
102 chmod a+x pbcopy pbpaste
103 export PATH=$(pwd):$PATH
105 LC_ALL="en_US.UTF-8" py.test $out/${python.sitePackages}/pandas --skip-slow --skip-network -k "$disabledTests"
110 # https://github.com/pandas-dev/pandas/issues/14866
111 # pandas devs are no longer testing i686 so safer to assume it's broken
112 broken = stdenv.isi686;
113 homepage = "https://pandas.pydata.org/";
114 description = "Python Data Analysis Library";
115 license = licenses.bsd3;
116 maintainers = with maintainers; [ raskin knedlsepp ];
117 platforms = platforms.unix;