mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
python3Packages.drf-flex-fields: init at 1.0.2
This commit is contained in:
parent
e1e2f77161
commit
d5b6a16d74
3 changed files with 83 additions and 0 deletions
64
pkgs/development/python-modules/drf-flex-fields/default.nix
Normal file
64
pkgs/development/python-modules/drf-flex-fields/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
appdirs,
|
||||
asgiref,
|
||||
attrs,
|
||||
black,
|
||||
click,
|
||||
django,
|
||||
djangorestframework,
|
||||
entrypoints,
|
||||
flake8,
|
||||
mccabe,
|
||||
mypy,
|
||||
mypy-extensions,
|
||||
pycodestyle,
|
||||
pyflakes,
|
||||
pytz,
|
||||
sqlparse,
|
||||
toml,
|
||||
typing-extensions,
|
||||
|
||||
# tests
|
||||
pytestCheckHook,
|
||||
pytest-django,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "drf-flex-fields";
|
||||
version = "1.0.2";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rsinger86";
|
||||
repo = "drf-flex-fields";
|
||||
tag = version;
|
||||
hash = "sha256-+9ToxCEIDpsA+BK8Uk0VueVjoId41/S93+a716EGvCU=";
|
||||
};
|
||||
|
||||
patches = [ ./django4-compat.patch ];
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
django
|
||||
djangorestframework
|
||||
pytestCheckHook
|
||||
pytest-django
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export DJANGO_SETTINGS_MODULE=tests.settings
|
||||
'';
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/rsinger86/drf-flex-fields/releases/tag/${src.tag}";
|
||||
description = "Dynamically set fields and expand nested resources in Django REST Framework serializers";
|
||||
homepage = "https://github.com/rsinger86/drf-flex-fields";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ hexa ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
diff --git a/tests/urls.py b/tests/urls.py
|
||||
index 998b0aa..62996c0 100644
|
||||
--- a/tests/urls.py
|
||||
+++ b/tests/urls.py
|
||||
@@ -1,4 +1,5 @@
|
||||
-from django.conf.urls import url, include
|
||||
+from django.conf.urls import include
|
||||
+from django.urls import re_path
|
||||
from rest_framework import routers
|
||||
from tests.testapp.views import PetViewSet, TaggedItemViewSet
|
||||
|
||||
@@ -7,4 +8,4 @@ router = routers.DefaultRouter()
|
||||
router.register(r"pets", PetViewSet, basename="pet")
|
||||
router.register(r"tagged-items", TaggedItemViewSet, basename="tagged-item")
|
||||
|
||||
-urlpatterns = [url(r"^", include(router.urls))]
|
||||
+urlpatterns = [re_path(r"^", include(router.urls))]
|
|
@ -4201,6 +4201,8 @@ self: super: with self; {
|
|||
|
||||
drf-extra-fields = callPackage ../development/python-modules/drf-extra-fields { };
|
||||
|
||||
drf-flex-fields = callPackage ../development/python-modules/drf-flex-fields { };
|
||||
|
||||
drf-jwt = callPackage ../development/python-modules/drf-jwt { };
|
||||
|
||||
drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue