about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2017-12-14 16:49:19 +0000
committerGitHub <noreply@github.com>2017-12-14 16:49:19 +0000
commitfbc452c836d1cd8f923621086eead2abfd2b1698 (patch)
tree22f247e6869c69dda057f0d4d26596ff4f353356 /pkgs
parent98d1da90bd94cfd7f4e2cd0418a6955a1acec85f (diff)
parent5551af487ff9581bedf3079ac6ac5ce8245b8572 (diff)
downloadnixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar.gz
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar.bz2
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar.lz
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar.xz
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.tar.zst
nixlib-fbc452c836d1cd8f923621086eead2abfd2b1698.zip
Merge pull request #32202 from ilya-kolpakov/python-quandl
pythonPackages.quandl: 3.0.0 -> 3.2.1
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/inflection/default.nix23
-rw-r--r--pkgs/development/python-modules/jsondate/default.nix22
-rw-r--r--pkgs/development/python-modules/quandl/allow-requests-v2.18.patch12
-rw-r--r--pkgs/development/python-modules/quandl/default.nix59
-rw-r--r--pkgs/top-level/python-packages.nix54
5 files changed, 123 insertions, 47 deletions
diff --git a/pkgs/development/python-modules/inflection/default.nix b/pkgs/development/python-modules/inflection/default.nix
new file mode 100644
index 000000000000..bccf49c56adf
--- /dev/null
+++ b/pkgs/development/python-modules/inflection/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchPypi, buildPythonPackage, pytest } :
+
+buildPythonPackage rec {
+  pname = "inflection";
+  version = "0.3.1";
+
+  src = fetchPypi {
+   inherit pname version;
+   sha256 = "1jhnxgnw8y3mbzjssixh6qkc7a3afc4fygajhqrqalnilyvpzshq";
+  };
+
+  checkInputs = [ pytest ];
+  # Suppress overly verbose output if tests run successfully
+  checkPhase = ''pytest >/dev/null || pytest'';
+
+  meta = {
+   homepage = https://github.com/jpvanhal/inflection;
+   description = "A port of Ruby on Rails inflector to Python";
+   maintainers = with lib.maintainers; [ NikolaMandic ilya-kolpakov ];
+   license = lib.licenses.mit;
+  };
+}
+
diff --git a/pkgs/development/python-modules/jsondate/default.nix b/pkgs/development/python-modules/jsondate/default.nix
new file mode 100644
index 000000000000..7888a6df23cc
--- /dev/null
+++ b/pkgs/development/python-modules/jsondate/default.nix
@@ -0,0 +1,22 @@
+{ lib, fetchFromGitHub, buildPythonPackage, six }:
+
+buildPythonPackage rec {
+  version = "0.1.3";
+  pname = "jsondate";
+
+  src = fetchFromGitHub {
+    owner = "ilya-kolpakov";
+    repo = "jsondate";
+    rev = "refs/tags/v${version}";
+    sha256 = "0nhvi48nc0bmad5ncyn6c9yc338krs3xf10bvv55xgz25c5gdgwy";
+    fetchSubmodules = true; # Fetching by tag does not work otherwise
+  };
+
+  propagatedBuildInputs = [ six ];
+
+  meta = {
+    homepage = "https://github.com/ilya-kolpakov/jsondate";
+    description = "JSON with datetime handling";
+    license = lib.licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/quandl/allow-requests-v2.18.patch b/pkgs/development/python-modules/quandl/allow-requests-v2.18.patch
new file mode 100644
index 000000000000..c4d14319a8b6
--- /dev/null
+++ b/pkgs/development/python-modules/quandl/allow-requests-v2.18.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+--- a/setup.py
++++ b/setup.py
+@@ -18,7 +18,7 @@ from version import VERSION  # NOQA
+ install_requires = [
+     'pandas >= 0.14',
+     'numpy >= 1.8',
+-    'requests >= 2.7.0, < 2.18',  # Version 2.18 appears to break pulling data.
++    'requests >= 2.7.0', # Works fine
+     'inflection >= 0.3.1',
+     'python-dateutil',
+     'six',
diff --git a/pkgs/development/python-modules/quandl/default.nix b/pkgs/development/python-modules/quandl/default.nix
new file mode 100644
index 000000000000..e85e9c4e0f8c
--- /dev/null
+++ b/pkgs/development/python-modules/quandl/default.nix
@@ -0,0 +1,59 @@
+{
+  lib, fetchFromGitHub, buildPythonPackage, isPy3k,
+  # runtime dependencies
+  pandas, numpy, requests, inflection, python-dateutil, six, more-itertools,
+  # test suite dependencies
+  nose, unittest2, flake8, httpretty, mock, factory_boy, jsondate,
+  # additional runtime dependencies are required on Python 2.x
+  pyOpenSSL ? null, ndg-httpsclient ? null, pyasn1 ? null
+}:
+
+buildPythonPackage rec {
+  pname = "quandl";
+  version = "3.2.1";
+  sha256 = "0vc0pzs2px9yaqkqcmd2m1b2bq1iils8fs0xbl0989hjq791a4jr";
+
+  patches = [ ./allow-requests-v2.18.patch ];
+
+  # Tests do not work with fetchPypi
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = "quandl-python";
+    rev = "refs/tags/v${version}";
+    inherit sha256;
+    fetchSubmodules = true; # Fetching by tag does not work otherwise
+  };
+
+  doCheck = true;
+
+  checkInputs = [
+    nose
+    unittest2
+    flake8
+    httpretty
+    mock
+    factory_boy
+    jsondate
+  ];
+
+  propagatedBuildInputs = [
+    pandas
+    numpy
+    requests
+    inflection
+    python-dateutil
+    six
+    more-itertools
+  ] ++ lib.optional (!isPy3k) [
+    pyOpenSSL
+    ndg-httpsclient
+    pyasn1
+  ];
+
+  meta = {
+    homepage = "https://github.com/quandl/quandl-python";
+    description = "Quandl Python client library";
+    maintainers = [ lib.maintainers.ilya-kolpakov ];
+    license = lib.licenses.mit;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index e89f5f89ac6c..015edb4ef701 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -9675,24 +9675,7 @@ in {
     };
   };
 
-
-  inflection = buildPythonPackage rec {
-     version = "0.3.1";
-     name = "inflection-${version}";
-
-     src = pkgs.fetchurl {
-       url= "mirror://pypi/i/inflection/${name}.tar.gz";
-       sha256 = "1jhnxgnw8y3mbzjssixh6qkc7a3afc4fygajhqrqalnilyvpzshq";
-     };
-
-     disabled = isPy3k;
-
-     meta = {
-       homepage = https://github.com/jpvanhal/inflection;
-       description = "A port of Ruby on Rails inflector to Python";
-       maintainers = with maintainers; [ NikolaMandic ];
-     };
-  };
+  inflection = callPackage ../development/python-modules/inflection { };
 
   influxdb = buildPythonPackage rec {
     name = "influxdb-4.0.0";
@@ -10029,6 +10012,8 @@ in {
     inherit (self) systemd pytest;
   };
 
+  jsondate = callPackage ../development/python-modules/jsondate { };
+
   jsonnet = buildPythonPackage {
     inherit (pkgs.jsonnet) name src;
     # Python 3 is not yet supported https://github.com/google/jsonnet/pull/335
@@ -16910,6 +16895,10 @@ in {
     };
   };
 
+  quandl = callPackage ../development/python-modules/quandl { };
+  # alias for an older package which did not support Python 3
+  Quandl = callPackage ../development/python-modules/quandl { };
+
   qscintilla = disabledIf (isPy3k || isPyPy)
     (buildPythonPackage rec {
       # TODO: Qt5 support
@@ -23529,35 +23518,6 @@ EOF
     };
   };
 
-  Quandl = buildPythonPackage rec {
-    version = "3.0.0";
-    name = "Quandl-${version}";
-
-    src = pkgs.fetchurl {
-      url= "mirror://pypi/q/quandl/${name}.tar.gz";
-      sha256 = "d4e698eb39291e0b281975813054101f3dfb379dead10d34d7b536e1aad60584";
-    };
-
-    propagatedBuildInputs = with self; [
-      numpy
-      ndg-httpsclient
-      dateutil
-      inflection
-      more-itertools
-      requests
-      pandas
-    ];
-
-    # No tests in archive
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/quandl/quandl-python;
-      description = "A Python library for Quandl’s RESTful API";
-      maintainers = with maintainers; [ NikolaMandic ];
-    };
-  };
-
   queuelib = buildPythonPackage rec {
     name = "queuelib-${version}";
     version = "1.4.2";