nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python3Packages.drf-flex-fields: init at 1.0.2

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