nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 django,
12
13 # optional-dependencies
14 coreapi,
15 coreschema,
16 django-guardian,
17 inflection,
18 psycopg2,
19 pygments,
20 pyyaml,
21
22 # tests
23 pytestCheckHook,
24 pytest-django,
25 pytz,
26}:
27
28buildPythonPackage (finalAttrs: {
29 pname = "djangorestframework";
30 version = "3.16.1";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "encode";
35 repo = "django-rest-framework";
36 tag = finalAttrs.version;
37 hash = "sha256-kjviZFuGt/x0RSc7wwl/+SeYQ5AGuv0e7HMhAmu4IgY=";
38 };
39
40 build-system = [ setuptools ];
41
42 dependencies = [
43 django
44 ];
45
46 optional-dependencies = {
47 complete = [
48 coreapi
49 coreschema
50 django-guardian
51 inflection
52 psycopg2
53 pygments
54 pyyaml
55 ];
56 };
57
58 nativeCheckInputs = [
59 pytest-django
60 pytestCheckHook
61 pytz
62 ]
63 ++ finalAttrs.passthru.optional-dependencies.complete;
64
65 disabledTests = [
66 # https://github.com/encode/django-rest-framework/issues/9422
67 "test_urlpatterns"
68 ];
69
70 pythonImportsCheck = [ "rest_framework" ];
71
72 meta = {
73 changelog = "https://github.com/encode/django-rest-framework/releases/tag/${finalAttrs.src.tag}";
74 description = "Web APIs for Django, made easy";
75 homepage = "https://www.django-rest-framework.org/";
76 license = lib.licenses.bsd2;
77 };
78})