2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchFromGitHub
|
2020-02-06 20:38:41 +00:00
|
|
|
, matplotlib
|
|
|
|
, mock
|
|
|
|
, numpy
|
|
|
|
, pillow
|
2020-12-29 21:07:31 +00:00
|
|
|
, cython
|
2020-02-06 20:38:41 +00:00
|
|
|
, pytestcov
|
2020-12-29 21:07:31 +00:00
|
|
|
, pytest
|
|
|
|
, fetchpatch
|
2020-02-06 20:38:41 +00:00
|
|
|
}:
|
2020-07-07 13:32:23 +01:00
|
|
|
|
2020-02-06 20:38:41 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "word_cloud";
|
2020-12-29 21:07:31 +00:00
|
|
|
version = "1.8.1";
|
2020-02-06 20:38:41 +00:00
|
|
|
|
|
|
|
# tests are not included in pypi tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "amueller";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-12-29 21:07:31 +00:00
|
|
|
sha256 = "sha256-4EFQfv+Jn9EngUAyDoJP0yv9zr9Tnbrdwq1YzDacB9Q=";
|
2020-02-06 20:38:41 +00:00
|
|
|
};
|
|
|
|
|
2020-12-29 21:07:31 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
2020-02-06 20:38:41 +00:00
|
|
|
propagatedBuildInputs = [ matplotlib numpy pillow ];
|
|
|
|
|
|
|
|
# Tests require extra dependencies
|
2020-07-07 13:32:23 +01:00
|
|
|
checkInputs = [ mock pytest pytestcov ];
|
2020-12-29 21:07:31 +00:00
|
|
|
|
2020-02-06 20:38:41 +00:00
|
|
|
checkPhase = ''
|
2020-12-29 21:07:31 +00:00
|
|
|
PATH=$out/bin:$PATH pytest test
|
2020-02-06 20:38:41 +00:00
|
|
|
'';
|
2020-07-07 13:32:23 +01:00
|
|
|
|
2020-12-29 21:07:31 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# https://github.com/amueller/word_cloud/pull/616
|
|
|
|
url = "https://github.com/amueller/word_cloud/commit/858a8ac4b5b08494c1d25d9e0b35dd995151a1e5.patch";
|
|
|
|
sha256 = "sha256-+aDTMPtOibVwjPrRLxel0y4JFD5ERB2bmJi4zRf/asg=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-06 20:38:41 +00:00
|
|
|
description = "A little word cloud generator in Python";
|
|
|
|
homepage = "https://github.com/amueller/word_cloud";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jm2dev ];
|
|
|
|
};
|
|
|
|
}
|