1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mock,
6 pillow,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "pilkit";
14 version = "3.0";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "matthewwithanm";
21 repo = pname;
22 tag = version;
23 hash = "sha256-NmD9PFCkz3lz4AnGoQUpkt35q0zvDVm+kx7lVDFBcHk=";
24 };
25
26 nativeBuildInputs = [ setuptools ];
27
28 propagatedBuildInputs = [ pillow ];
29
30 nativeCheckInputs = [
31 mock
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 substituteInPlace tox.ini \
37 --replace " --cov --cov-report term-missing:skip-covered" ""
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; [ domenkozar ];
49 };
50}