diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 2eaface2e3a..a50dabf9941 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -286,6 +286,7 @@ iblech = "Ingo Blechschmidt "; igsha = "Igor Sharonov "; ikervagyok = "Balázs Lengyel "; + ilya-kolpakov = "Ilya Kolpakov "; infinisil = "Silvan Mosberger "; ironpinguin = "Michele Catalano "; ivan-tkatchev = "Ivan Tkatchev "; diff --git a/pkgs/development/python-modules/inflection/default.nix b/pkgs/development/python-modules/inflection/default.nix new file mode 100644 index 00000000000..bccf49c56ad --- /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 00000000000..7888a6df23c --- /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 00000000000..c4d14319a8b --- /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 00000000000..e85e9c4e0f8 --- /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 e89f5f89ac6..015edb4ef70 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";