1{
2 lib,
3 buildPythonPackage,
4 django,
5 djangorestframework,
6 fetchFromGitHub,
7 filetype,
8 pillow,
9 psycopg2,
10 pytest-django,
11 pytestCheckHook,
12 pythonAtLeast,
13 setuptools,
14 pytz,
15}:
16
17buildPythonPackage rec {
18 pname = "drf-extra-fields";
19 version = "3.7.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "hipo";
24 repo = "drf-extra-fields";
25 tag = "v${version}";
26 hash = "sha256-Ym4vnZ/t0ZdSxU53BC0ducJl1YiTygRSWql/35PNbOU";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 django
33 djangorestframework
34 filetype
35 ];
36
37 optional-dependencies = {
38 Base64ImageField = [ pillow ];
39 };
40
41 nativeCheckInputs = [
42 (django.override { withGdal = true; })
43 psycopg2
44 pytestCheckHook
45 pytest-django
46 pytz
47 ] ++ optional-dependencies.Base64ImageField;
48
49 pythonImportsCheck = [ "drf_extra_fields" ];
50
51 disabledTests = lib.optionals (pythonAtLeast "3.13") [
52 # https://github.com/Hipo/drf-extra-fields/issues/210
53 "test_read_source_with_context"
54
55 # pytz causes the following tests to fail
56 "test_create"
57 "test_create_with_base64_prefix"
58 "test_create_with_webp_image"
59 "test_remove_with_empty_string"
60 ];
61
62 meta = {
63 description = "Extra Fields for Django Rest Framework";
64 homepage = "https://github.com/Hipo/drf-extra-fields";
65 changelog = "https://github.com/Hipo/drf-extra-fields/releases/tag/${src.rev}";
66 license = lib.licenses.asl20;
67 maintainers = with lib.maintainers; [ felbinger ];
68 };
69}