summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2016-03-12 19:02:58 -0500
committerFrederik Rietdijk <fridh@fridh.nl>2016-03-16 17:55:52 -0400
commit8585441ae5266c7b428d68e301cf677545da4eb9 (patch)
tree612add1928d128c9055a02313b84040c880d581e /pkgs/top-level
parentf2d2d515ee1b929b85a6f8ea2cf0daf6bd7c1097 (diff)
downloadnixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar.gz
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar.bz2
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar.lz
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar.xz
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.tar.zst
nixlib-8585441ae5266c7b428d68e301cf677545da4eb9.zip
pythonPackages.pandas_18: init at 0.18.0
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/python-packages.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ec6458ab59f5..9b330d8c8202 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -14645,6 +14645,79 @@ in modules // {
     };
   };
 
+  pandas_18 = let
+    inherit (pkgs.stdenv.lib) optional optionalString;
+    inherit (pkgs.stdenv) isDarwin;
+  in buildPythonPackage rec {
+    name = "pandas-${version}";
+    version = "0.18.0";
+
+    src = pkgs.fetchurl {
+      url = "https://pypi.python.org/packages/source/p/pandas/${name}.tar.gz";
+      sha256 = "050qw0ap5bhyv5flp78x3lcq1dlminl3xaj6kbrm0jqmx0672xf9";
+    };
+
+
+    LC_ALL = "en_US.UTF-8";
+    buildInputs = with self; [ nose pkgs.glibcLocales ] ++ optional isDarwin pkgs.libcxx;
+    propagatedBuildInputs = with self; [
+      dateutil
+      scipy
+      numexpr
+      pytz
+      xlrd
+      bottleneck
+      sqlalchemy
+      lxml
+      html5lib
+      modules.sqlite3
+      beautifulsoup4
+      openpyxl
+      xlwt
+    ] ++ optional isDarwin pkgs.darwin.locale; # provides the locale command
+
+    # For OSX, we need to add a dependency on libcxx, which provides
+    # `complex.h` and other libraries that pandas depends on to build.
+    patchPhase = optionalString isDarwin ''
+      cpp_sdk="${pkgs.libcxx}/include/c++/v1";
+      echo "Adding $cpp_sdk to the setup.py common_include variable"
+      substituteInPlace setup.py \
+        --replace "['pandas/src/klib', 'pandas/src']" \
+                  "['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
+
+      # disable clipboard tests since pbcopy/pbpaste are not open source
+      substituteInPlace pandas/io/tests/test_clipboard.py \
+        --replace pandas.util.clipboard no_such_module \
+        --replace OSError ImportError
+    '';
+
+    # The flag `-A 'not network'` will disable tests that use internet.
+    # The `-e` flag disables a few problematic tests.
+    # https://github.com/pydata/pandas/issues/11169
+    # https://github.com/pydata/pandas/issues/11287
+    # The test_sql checks fail specifically on python 3.5; see here:
+    # https://github.com/pydata/pandas/issues/11112
+    checkPhase = let
+      testsToSkip = [];
+    in ''
+      runHook preCheck
+      # The flag `-A 'not network'` will disable tests that use internet.
+      # The `-e` flag disables a few problematic tests.
+      ${python.executable} setup.py nosetests -A 'not slow and not network' \
+         --verbosity=3
+
+      runHook postCheck
+    '';
+
+    meta = {
+      homepage = "http://pandas.pydata.org/";
+      description = "Python Data Analysis Library";
+      license = licenses.bsd3;
+      maintainers = with maintainers; [ raskin fridh ];
+      platforms = platforms.unix;
+    };
+  };
+
   xlrd = buildPythonPackage rec {
     name = "xlrd-${version}";