1{ lib, buildPythonPackage, fetchFromGitHub 2, matplotlib 3, mock 4, numpy 5, pillow 6, cython 7, pytest-cov 8, pytest 9, fetchpatch 10}: 11 12buildPythonPackage rec { 13 pname = "word_cloud"; 14 version = "1.8.1"; 15 16 # tests are not included in pypi tarball 17 src = fetchFromGitHub { 18 owner = "amueller"; 19 repo = pname; 20 rev = version; 21 sha256 = "sha256-4EFQfv+Jn9EngUAyDoJP0yv9zr9Tnbrdwq1YzDacB9Q="; 22 }; 23 24 nativeBuildInputs = [ cython ]; 25 propagatedBuildInputs = [ matplotlib numpy pillow ]; 26 27 # Tests require extra dependencies 28 checkInputs = [ mock pytest pytest-cov ]; 29 30 checkPhase = '' 31 PATH=$out/bin:$PATH pytest test 32 ''; 33 34 patches = [ 35 (fetchpatch { 36 # https://github.com/amueller/word_cloud/pull/616 37 url = "https://github.com/amueller/word_cloud/commit/858a8ac4b5b08494c1d25d9e0b35dd995151a1e5.patch"; 38 sha256 = "sha256-+aDTMPtOibVwjPrRLxel0y4JFD5ERB2bmJi4zRf/asg="; 39 }) 40 ]; 41 42 meta = with lib; { 43 description = "A little word cloud generator in Python"; 44 homepage = "https://github.com/amueller/word_cloud"; 45 license = licenses.mit; 46 maintainers = with maintainers; [ jm2dev ]; 47 }; 48}