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
75
76
77
78
79
80
81
82
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
# build-system
setuptools,
# dependencies
django,
pytz,
# optional-dependencies
coreapi,
coreschema,
django-guardian,
inflection,
psycopg2,
pygments,
pyyaml,
# tests
pytestCheckHook,
pytest-django,
}:
buildPythonPackage rec {
pname = "djangorestframework";
version = "3.16.0";
pyproject = true;
src = fetchFromGitHub {
owner = "encode";
repo = "django-rest-framework";
rev = version;
hash = "sha256-LFq8mUx+jAFFnQTfysYs+DSN941p+8h9mDDOp+LO7VU=";
};
build-system = [ setuptools ];
dependencies = [
django
pygments
]
++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz);
optional-dependencies = {
complete = [
coreschema
django-guardian
inflection
psycopg2
pygments
pyyaml
]
++ lib.optionals (pythonOlder "3.13") [
# broken on 3.13
coreapi
];
};
nativeCheckInputs = [
pytest-django
pytestCheckHook
]
++ optional-dependencies.complete;
disabledTests = [
# https://github.com/encode/django-rest-framework/issues/9422
"test_urlpatterns"
];
pythonImportsCheck = [ "rest_framework" ];
meta = {
changelog = "https://github.com/encode/django-rest-framework/releases/tag/3.15.1";
description = "Web APIs for Django, made easy";
homepage = "https://www.django-rest-framework.org/";
license = lib.licenses.bsd2;
};
}
|