Skip to content

Commit

Permalink
Resurrect pandas 0.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Oct 6, 2017
1 parent 75bd873 commit 96874c6
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
56 changes: 56 additions & 0 deletions pkgs/development/python-modules/scipy/0.17.1.nix
@@ -0,0 +1,56 @@
{lib, fetchurl, python, buildPythonPackage, isPyPy, gfortran, nose, numpy}:

buildPythonPackage rec {
pname = "scipy";
version = "0.17.1";
name = "${pname}-${version}";

src = fetchurl {
url = "mirror://pypi/s/scipy/scipy-${version}.tar.gz";
sha256 = "1b1qpfz2j2rvmlplsjbnznnxnqr9ckbmis506110ii1w07wd4k4w";
};

buildInputs = [ gfortran nose numpy.blas ];
propagatedBuildInputs = [ numpy ];

# Remove tests because of broken wrapper
prePatch = ''
rm scipy/linalg/tests/test_lapack.py
'';

preConfigure = ''
sed -i '0,/from numpy.distutils.core/s//import setuptools;from numpy.distutils.core/' setup.py
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
'';

preBuild = ''
echo "Creating site.cfg file..."
cat << EOF > site.cfg
[openblas]
include_dirs = ${numpy.blas}/include
library_dirs = ${numpy.blas}/lib
EOF
'';

enableParallelBuilding = true;

checkPhase = ''
runHook preCheck
pushd dist
${python.interpreter} -c 'import scipy; scipy.test("fast", verbose=10)'
popd
runHook postCheck
'';

passthru = {
blas = numpy.blas;
};

setupPyBuildFlags = [ "--fcompiler='gnu95'" ];

meta = {
description = "SciPy (pronounced 'Sigh Pie') is open-source software for mathematics, science, and engineering. ";
homepage = http://www.scipy.org/;
maintainers = with lib.maintainers; [ fridh ];
};
}
55 changes: 55 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -14990,6 +14990,59 @@ in {

pandas = callPackage ../development/python-modules/pandas { };

pandas_17 = let
inherit (pkgs.stdenv.lib) optional optionalString;
inherit (pkgs.stdenv) isDarwin;
in buildPythonPackage rec {
name = "pandas-${version}";
version = "0.17.1";

src = pkgs.fetchurl {
url = "https://pypi.python.org/packages/source/p/pandas/${name}.tar.gz";
sha256 = "cfd7214a7223703fe6999fbe34837749540efee1c985e6aee9933f30e3f72837";
};

buildInputs = with self; [ nose ] ++ optional isDarwin pkgs.libcxx;
propagatedBuildInputs = with self; [
dateutil
scipy_0_17
numexpr
pytz
xlrd
bottleneck
sqlalchemy
lxml
html5lib
# modules.sqlite3
beautifulsoup4
] ++ 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
'';

doCheck = false;

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}";

Expand Down Expand Up @@ -19348,6 +19401,8 @@ in {

scipy = callPackage ../development/python-modules/scipy { };

scipy_0_17 = callPackage ../development/python-modules/scipy/0.17.1.nix { };

scikitimage = buildPythonPackage rec {
name = "scikit-image-${version}";
version = "0.12.3";
Expand Down

1 comment on commit 96874c6

@FRidh
Copy link
Member

@FRidh FRidh commented on 96874c6 Oct 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this version? We don't have any package using this version.

Please sign in to comment.