From d56e52fd4634e10678333a34d7b37960dde8c832 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sun, 20 Oct 2024 09:30:44 +0000 Subject: [PATCH] python3Packages.djangorestframework-jsonp: init at 1.0.2 --- .../djangorestframework-jsonp/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/djangorestframework-jsonp/default.nix diff --git a/pkgs/development/python-modules/djangorestframework-jsonp/default.nix b/pkgs/development/python-modules/djangorestframework-jsonp/default.nix new file mode 100644 index 0000000000000..af0b28037d7f7 --- /dev/null +++ b/pkgs/development/python-modules/djangorestframework-jsonp/default.nix @@ -0,0 +1,56 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + django, + python, + pytest-django, + pytestCheckHook, + djangorestframework, + setuptools, +}: + +buildPythonPackage rec { + pname = "djangorestframework-jsonp"; + version = "1.0.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jpadilla"; + repo = "django-rest-framework-jsonp"; + rev = "refs/tags/${version}"; + hash = "sha256-4mIO69GhtvbQBtztHVQYIDDDSZpKg0g7BFNHEupiYTs="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + django + djangorestframework + ]; + + checkInputs = [ + pytestCheckHook + pytest-django + ]; + + # Test fail with Django >=4 + # https://github.com/jpadilla/django-rest-framework-jsonp/issues/14 + doCheck = false; + + checkPhase = '' + runHook preCheck + rm tests/test_renderers.py + ${python.interpreter} runtests.py + runHook postCheck + ''; + + pythonImportsCheck = [ "rest_framework_jsonp" ]; + + meta = { + description = "JSONP support for Django REST Framework"; + homepage = "https://jpadilla.github.io/django-rest-framework-jsonp/"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.onny ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index edde228999dde..37cf738aeaf4a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3522,6 +3522,8 @@ self: super: with self; { djangorestframework-guardian2 = callPackage ../development/python-modules/djangorestframework-guardian2 { }; + djangorestframework-jsonp = callPackage ../development/python-modules/djangorestframework-jsonp { }; + djangorestframework-recursive = callPackage ../development/python-modules/djangorestframework-recursive { }; djangorestframework-simplejwt = callPackage ../development/python-modules/djangorestframework-simplejwt { };