tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
0
fork
atom
overview
issues
pulls
pipelines
python3Packages.drf-flex-fields: init at 1.0.2
Martin Weinelt
10 months ago
d5b6a16d
e1e2f771
+83
3 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
drf-flex-fields
default.nix
django4-compat.patch
top-level
python-packages.nix
+64
pkgs/development/python-modules/drf-flex-fields/default.nix
reviewed
···
1
1
+
{
2
2
+
lib,
3
3
+
buildPythonPackage,
4
4
+
fetchFromGitHub,
5
5
+
setuptools,
6
6
+
appdirs,
7
7
+
asgiref,
8
8
+
attrs,
9
9
+
black,
10
10
+
click,
11
11
+
django,
12
12
+
djangorestframework,
13
13
+
entrypoints,
14
14
+
flake8,
15
15
+
mccabe,
16
16
+
mypy,
17
17
+
mypy-extensions,
18
18
+
pycodestyle,
19
19
+
pyflakes,
20
20
+
pytz,
21
21
+
sqlparse,
22
22
+
toml,
23
23
+
typing-extensions,
24
24
+
25
25
+
# tests
26
26
+
pytestCheckHook,
27
27
+
pytest-django,
28
28
+
}:
29
29
+
30
30
+
buildPythonPackage rec {
31
31
+
pname = "drf-flex-fields";
32
32
+
version = "1.0.2";
33
33
+
pyproject = true;
34
34
+
35
35
+
src = fetchFromGitHub {
36
36
+
owner = "rsinger86";
37
37
+
repo = "drf-flex-fields";
38
38
+
tag = version;
39
39
+
hash = "sha256-+9ToxCEIDpsA+BK8Uk0VueVjoId41/S93+a716EGvCU=";
40
40
+
};
41
41
+
42
42
+
patches = [ ./django4-compat.patch ];
43
43
+
44
44
+
build-system = [ setuptools ];
45
45
+
46
46
+
nativeCheckInputs = [
47
47
+
django
48
48
+
djangorestframework
49
49
+
pytestCheckHook
50
50
+
pytest-django
51
51
+
];
52
52
+
53
53
+
preCheck = ''
54
54
+
export DJANGO_SETTINGS_MODULE=tests.settings
55
55
+
'';
56
56
+
57
57
+
meta = {
58
58
+
changelog = "https://github.com/rsinger86/drf-flex-fields/releases/tag/${src.tag}";
59
59
+
description = "Dynamically set fields and expand nested resources in Django REST Framework serializers";
60
60
+
homepage = "https://github.com/rsinger86/drf-flex-fields";
61
61
+
license = lib.licenses.mit;
62
62
+
maintainers = with lib.maintainers; [ hexa ];
63
63
+
};
64
64
+
}
+17
pkgs/development/python-modules/drf-flex-fields/django4-compat.patch
reviewed
···
1
1
+
diff --git a/tests/urls.py b/tests/urls.py
2
2
+
index 998b0aa..62996c0 100644
3
3
+
--- a/tests/urls.py
4
4
+
+++ b/tests/urls.py
5
5
+
@@ -1,4 +1,5 @@
6
6
+
-from django.conf.urls import url, include
7
7
+
+from django.conf.urls import include
8
8
+
+from django.urls import re_path
9
9
+
from rest_framework import routers
10
10
+
from tests.testapp.views import PetViewSet, TaggedItemViewSet
11
11
+
12
12
+
@@ -7,4 +8,4 @@ router = routers.DefaultRouter()
13
13
+
router.register(r"pets", PetViewSet, basename="pet")
14
14
+
router.register(r"tagged-items", TaggedItemViewSet, basename="tagged-item")
15
15
+
16
16
+
-urlpatterns = [url(r"^", include(router.urls))]
17
17
+
+urlpatterns = [re_path(r"^", include(router.urls))]
+2
pkgs/top-level/python-packages.nix
reviewed
···
4201
4201
4202
4202
drf-extra-fields = callPackage ../development/python-modules/drf-extra-fields { };
4203
4203
4204
4204
+
drf-flex-fields = callPackage ../development/python-modules/drf-flex-fields { };
4205
4205
+
4204
4206
drf-jwt = callPackage ../development/python-modules/drf-jwt { };
4205
4207
4206
4208
drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { };