summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/easy-thumbnails/default.nix
blob: 6b0a2881c8e52119688468591ddbb49559321f7a (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
  lib,
  buildPythonPackage,
  django,
  fetchFromGitHub,
  fetchpatch,
  pillow,
  reportlab,
  svglib,
  pytestCheckHook,
  pytest-django,
  setuptools,
  testfixtures,
}:

buildPythonPackage rec {
  pname = "easy-thumbnails";
  version = "2.10.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "SmileyChris";
    repo = "easy-thumbnails";
    tag = version;
    hash = "sha256-8JTHYQIBbu/4fknK2ZEQeDSgaxKGDfflxumcFMpaGQk=";
  };

  patches = [
    (fetchpatch {
      name = "python313-compat.patch";
      url = "https://github.com/SmileyChris/easy-thumbnails/pull/650.patch";
      hash = "sha256-qD/YnDlDZ7DghLv/mxjQ2o6pSl3fGR+Ipx5NX2BV6zc=";
    })
  ];

  build-system = [ setuptools ];

  dependencies = [
    django
    pillow
  ];

  optional-dependencies.svg = [
    reportlab
    svglib
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-django
  ]
  ++ lib.concatAttrValues optional-dependencies;

  checkInputs = [ testfixtures ];

  disabledTests = [
    # AssertionError: 'ERROR' != 'INFO'
    "test_postprocessor"
  ];

  preCheck = ''
    export DJANGO_SETTINGS_MODULE="easy_thumbnails.tests.settings"
  '';

  pythonImportsCheck = [ "easy_thumbnails" ];

  meta = {
    description = "Easy thumbnails for Django";
    homepage = "https://github.com/SmileyChris/easy-thumbnails";
    changelog = "https://github.com/SmileyChris/easy-thumbnails/blob/${version}/CHANGES.rst";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.onny ];
  };
}