4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ lib, stdenv, 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 ];
|
|
};
|
|
}
|