From e15c715daf4c59894cc0b35190dbc0918a187c4b Mon Sep 17 00:00:00 2001 From: Ilya Kolpakov Date: Thu, 30 Nov 2017 13:48:46 +0100 Subject: [PATCH] pythonPackages.quandl: init at 3.2.1 --- .../quandl/allow-requests-v2.18.patch | 12 ++++ .../python-modules/quandl/default.nix | 61 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 1 + 3 files changed, 74 insertions(+) create mode 100644 pkgs/development/python-modules/quandl/allow-requests-v2.18.patch create mode 100644 pkgs/development/python-modules/quandl/default.nix 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..0184d25e31b0 --- /dev/null +++ b/pkgs/development/python-modules/quandl/default.nix @@ -0,0 +1,61 @@ +{ + 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 +}: + +let + version = "3.2.1"; + sha256 = "0vc0pzs2px9yaqkqcmd2m1b2bq1iils8fs0xbl0989hjq791a4jr"; + +in buildPythonPackage rec { + pname = "quandl"; + inherit version; + + patches = [ ./allow-requests-v2.18.patch ]; + + src = fetchFromGitHub { + owner = "quandl"; + 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 0df99e762b3e..6c5c5ffbc465 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -24440,6 +24440,7 @@ EOF inflection = callPackage ../development/python-modules/inflection { }; + quandl = callPackage ../development/python-modules/quandl { }; }); in fix' (extends overrides packages)