1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, pillow
6, pytestCheckHook
7, pythonOlder
8, setuptools
9}:
10
11buildPythonPackage rec {
12 pname = "pilkit";
13 version = "3.0";
14 pyproject = true;
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "matthewwithanm";
20 repo = pname;
21 rev = "refs/tags/${version}";
22 hash = "sha256-NmD9PFCkz3lz4AnGoQUpkt35q0zvDVm+kx7lVDFBcHk=";
23 };
24
25 nativeBuildInputs = [
26 setuptools
27 ];
28
29 propagatedBuildInputs = [
30 pillow
31 ];
32
33 nativeCheckInputs = [
34 mock
35 pytestCheckHook
36 ];
37
38 postPatch = ''
39 substituteInPlace tox.ini \
40 --replace " --cov --cov-report term-missing:skip-covered" ""
41 substituteInPlace pilkit/processors/resize.py \
42 --replace "Image.ANTIALIAS" "Image.Resampling.LANCZOS"
43 '';
44
45 pythonImportsCheck = [
46 "pilkit"
47 ];
48
49 meta = with lib; {
50 description = "A collection of utilities and processors for the Python Imaging Library";
51 homepage = "https://github.com/matthewwithanm/pilkit/";
52 license = licenses.bsd3;
53 maintainers = with maintainers; [ domenkozar ];
54 };
55}