diff --git a/pkgs/development/python-modules/remotecv/default.nix b/pkgs/development/python-modules/remotecv/default.nix new file mode 100644 index 000000000000..2102cf064250 --- /dev/null +++ b/pkgs/development/python-modules/remotecv/default.nix @@ -0,0 +1,38 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, pillow, argparse, pyres, nose +, preggy, numpy, yanc, nose-focus, mock, opencv }: + +buildPythonPackage rec { + pname = "remotecv"; + version = "2.2.2"; + + propagatedBuildInputs = [ pillow argparse pyres ]; + + checkInputs = [ nose preggy numpy yanc nose-focus mock opencv ]; + + # PyPI tarball doesn't contain tests so let's use GitHub + src = fetchFromGitHub { + owner = "thumbor"; + repo = pname; + rev = version; + sha256 = "0slalp1x626ajy2cbdfifhxf0ffzckqdz6siqsqr6s03hrl877hy"; + }; + + # Remove unnecessary argparse dependency and some seemingly unnecessary + # version upper bounds because nixpkgs contains (or could contain) newer + # versions. + # See: https://github.com/thumbor/remotecv/issues/15 + patches = [ + ./install_requires.patch + ]; + + checkPhase = '' + nosetests --with-yanc -s tests/ + ''; + + meta = with stdenv.lib; { + description = "OpenCV worker for facial and feature recognition"; + homepage = https://github.com/thumbor/remotecv/wiki; + license = licenses.mit; + maintainers = with maintainers; [ jluttine ]; + }; +} diff --git a/pkgs/development/python-modules/remotecv/install_requires.patch b/pkgs/development/python-modules/remotecv/install_requires.patch new file mode 100644 index 000000000000..37203128486e --- /dev/null +++ b/pkgs/development/python-modules/remotecv/install_requires.patch @@ -0,0 +1,16 @@ +diff --git a/setup.py b/setup.py +index 70f765c..8003cda 100644 +--- a/setup.py ++++ b/setup.py +@@ -53,9 +53,8 @@ remotecv is an OpenCV worker for facial and feature recognition + }, + + install_requires=[ +- "argparse>=1.2.1,<1.3.0", +- "pyres>=1.5,<1.6", +- "Pillow>=4.3.0,<5.2.0", ++ "pyres>=1.5", ++ "Pillow>=4.3.0", + ], + + entry_points={ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7def4851e7ac..b55c18734b01 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -658,6 +658,8 @@ in { relatorio = callPackage ../development/python-modules/relatorio { }; + remotecv = callPackage ../development/python-modules/remotecv { }; + pyzufall = callPackage ../development/python-modules/pyzufall { }; rhpl = disabledIf isPy3k (callPackage ../development/python-modules/rhpl {});