git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26221 from knedlsepp/fix-pandas-darwin-build

pandas: Fix build on darwin

commit67f6f3a4202511fb6c74d9a5d09da79119da3e80 authorFrederik Rietdijk <freddyrietdijk@fridh.nl> dateTue 30 May 2017, 08:39 (9 years ago) parent165c116eb2994a
1 file changed+14−9
pkgs/development/python-modules/pandas/default.nix+14−9
pkgs/development/python-modules/pandas/default.nix+14−9
@@ -19,7 +19,6 @@
1919, openpyxl
2020, tables
2121, xlwt
22−, darwin ? {}
2322, libcxx ? null
2423}:
2524
@@ -53,7 +52,7 @@ in buildPythonPackage rec {
5352 openpyxl
5453 tables
5554 xlwt
56− ] ++ optional isDarwin darwin.locale; # provides the locale command
55+ ];
5756
5857 # For OSX, we need to add a dependency on libcxx, which provides
5958 # `complex.h` and other libraries that pandas depends on to build.
@@ -63,16 +62,22 @@ in buildPythonPackage rec {
6362 substituteInPlace setup.py \
6463 --replace "['pandas/src/klib', 'pandas/src']" \
6564 "['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
66−
67− # disable clipboard tests since pbcopy/pbpaste are not open source
68− substituteInPlace pandas/io/tests/test_clipboard.py \
69− --replace pandas.util.clipboard no_such_module \
70− --replace OSError ImportError
7165 '';
7266
7367 checkPhase = ''
7468 runHook preCheck
75− py.test $out/${python.sitePackages}/pandas --skip-slow --skip-network
69+ ''
70+ # TODO: Get locale and clipboard support working on darwin.
71+ # Until then we disable the tests.
72+ + optionalString isDarwin ''
73+ # Fake the impure dependencies pbpaste and pbcopy
74+ echo "#!/bin/sh" > pbcopy
75+ echo "#!/bin/sh" > pbpaste
76+ chmod a+x pbcopy pbpaste
77+ export PATH=$(pwd):$PATH
78+ '' + ''
79+ py.test $out/${python.sitePackages}/pandas --skip-slow --skip-network \
80+ ${if isDarwin then "-k 'not test_locale and not test_clipboard'" else ""}
7681 runHook postCheck
7782 '';
7883
@@ -83,7 +88,7 @@ in buildPythonPackage rec {
8388 homepage = "http://pandas.pydata.org/";
8489 description = "Python Data Analysis Library";
8590 license = stdenv.lib.licenses.bsd3;
86− maintainers = with stdenv.lib.maintainers; [ raskin fridh ];
91+ maintainers = with stdenv.lib.maintainers; [ raskin fridh knedlsepp ];
8792 platforms = stdenv.lib.platforms.unix;
8893 };
8994}