summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-stdimage/default.nix
blob: 7942c2388dacba147ea136df6315f9bb5f7a98e8 (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
{
  buildPythonPackage,
  fetchFromGitHub,
  lib,
  pytest-django,
  pytestCheckHook,
  setuptools-scm,
  pillow,
  pytest-cov-stub,
  django,
  gettext,
}:
buildPythonPackage (finalAttrs: {
  pname = "django-stdimage";
  version = "6.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "codingjoe";
    repo = "django-stdimage";
    tag = finalAttrs.version;
    hash = "sha256-uwVU3Huc5fitAweShJjcMW//GBeIpJcxqKKLGo/EdIs=";
  };

  build-system = [ setuptools-scm ];

  dependencies = [
    django
    pillow
  ];

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

  disabledTestPaths = [
    # These tests failed on Django 5 or later
    "tests/test_commands.py"
    "tests/test_models.py::TestModel::test_variations"
    "tests/test_models.py::TestModel::test_cropping"
    "tests/test_models.py::TestModel::test_custom_render_variations"
    "tests/test_models.py::TestModel::test_defer"
    "tests/test_models.py::TestModel::test_variations_deepcopy"
    "tests/test_models.py::TestUtils::test_render_variations_callback"
    "tests/test_models.py::TestUtils::test_render_variations_overwrite"
    "tests/test_models.py::TestJPEGField::test_convert"
    "tests/test_models.py::TestJPEGField::test_convert_multiple"
  ];

  pythonImportsCheck = [
    "stdimage"
    "stdimage.validators"
    "stdimage.models"
  ];

  nativeCheckInputs = [
    gettext
    pytest-django
    pytest-cov-stub
    pytestCheckHook
  ];

  meta = {
    description = "Django Standardized Image Field";
    homepage = "https://github.com/codingjoe/django-stdimage";
    changelog = "https://github.com/codingjoe/django-stdimage/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ kurogeek ];
  };
})