summary refs log tree commit diff
path: root/pkgs/development/python-modules/wordcloud/default.nix
blob: 80f22efbda8591cbb80a099913cac454a49c1407 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib, buildPythonPackage, fetchFromGitHub
, matplotlib
, mock
, numpy
, pillow
, cython
, pytestcov
, pytest
, fetchpatch
}:

buildPythonPackage rec {
  pname = "word_cloud";
  version = "1.8.1";

  # tests are not included in pypi tarball
  src = fetchFromGitHub {
    owner = "amueller";
    repo = pname;
    rev = version;
    sha256 = "sha256-4EFQfv+Jn9EngUAyDoJP0yv9zr9Tnbrdwq1YzDacB9Q=";
  };

  nativeBuildInputs = [ cython ];
  propagatedBuildInputs = [ matplotlib numpy pillow ];

  # Tests require extra dependencies
  checkInputs = [ mock pytest pytestcov ];

  checkPhase = ''
    PATH=$out/bin:$PATH pytest test
  '';

  patches = [
    (fetchpatch {
      # https://github.com/amueller/word_cloud/pull/616
      url = "https://github.com/amueller/word_cloud/commit/858a8ac4b5b08494c1d25d9e0b35dd995151a1e5.patch";
      sha256 = "sha256-+aDTMPtOibVwjPrRLxel0y4JFD5ERB2bmJi4zRf/asg=";
    })
  ];

  meta = with lib; {
    description = "A little word cloud generator in Python";
    homepage = "https://github.com/amueller/word_cloud";
    license = licenses.mit;
    maintainers = with maintainers; [ jm2dev ];
  };
}