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