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