diff --git a/pkgs/development/python-modules/wordcloud/default.nix b/pkgs/development/python-modules/wordcloud/default.nix index e04f17c214df..2ac682c775fe 100644 --- a/pkgs/development/python-modules/wordcloud/default.nix +++ b/pkgs/development/python-modules/wordcloud/default.nix @@ -1,35 +1,44 @@ -{ lib, buildPythonPackage, fetchFromGitHub +{ lib +, buildPythonPackage +, cython +, fetchFromGitHub +, fetchpatch , matplotlib , mock , numpy , pillow -, cython -, pytest-cov -, pytest -, fetchpatch +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { - pname = "word_cloud"; + pname = "wordcloud"; version = "1.8.1"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; - # tests are not included in pypi tarball src = fetchFromGitHub { owner = "amueller"; repo = pname; rev = version; - sha256 = "sha256-4EFQfv+Jn9EngUAyDoJP0yv9zr9Tnbrdwq1YzDacB9Q="; + hash = "sha256-4EFQfv+Jn9EngUAyDoJP0yv9zr9Tnbrdwq1YzDacB9Q="; }; - nativeBuildInputs = [ cython ]; - propagatedBuildInputs = [ matplotlib numpy pillow ]; + nativeBuildInputs = [ + cython + ]; - # Tests require extra dependencies - checkInputs = [ mock pytest pytest-cov ]; + propagatedBuildInputs = [ + matplotlib + numpy + pillow + ]; - checkPhase = '' - PATH=$out/bin:$PATH pytest test - ''; + checkInputs = [ + mock + pytestCheckHook + ]; patches = [ (fetchpatch { @@ -39,8 +48,26 @@ buildPythonPackage rec { }) ]; + postPatch = '' + substituteInPlace setup.cfg \ + --replace " --cov --cov-report xml --tb=short" "" + ''; + + preCheck = '' + cd test + ''; + + pythonImportsCheck = [ + "wordcloud" + ]; + + disabledTests = [ + # Don't tests CLI + "test_cli_as_executable" + ]; + meta = with lib; { - description = "A little word cloud generator in Python"; + description = "Word cloud generator in Python"; homepage = "https://github.com/amueller/word_cloud"; license = licenses.mit; maintainers = with maintainers; [ jm2dev ];