From 11820f11df27d0cb8dcfb68913f3a020f8be3e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 19 May 2022 02:19:04 +0200 Subject: [PATCH] python310Packages.django-rest-auth: adopt, prepare to run tests --- .../django-rest-auth/default.nix | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/django-rest-auth/default.nix b/pkgs/development/python-modules/django-rest-auth/default.nix index e04581b3574b..ac7fc4813e71 100644 --- a/pkgs/development/python-modules/django-rest-auth/default.nix +++ b/pkgs/development/python-modules/django-rest-auth/default.nix @@ -1,29 +1,51 @@ -{ lib, - fetchPypi, - django, - djangorestframework, - six, - buildPythonPackage +{ lib + , buildPythonPackage +, fetchFromGitHub +, django +, django-allauth +, djangorestframework +, drf-jwt +, responses +, six }: buildPythonPackage rec { pname = "django-rest-auth"; version = "0.9.5"; - src = fetchPypi { - inherit pname version; - sha256 = "f11e12175dafeed772f50d740d22caeab27e99a3caca24ec65e66a8d6de16571"; + src = fetchFromGitHub { + owner = "Tivix"; + repo = "django-rest-auth"; + rev = version; + sha256 = "sha256-rCChUHv8sTEFErDCZnPN5b5XVtMJ7JNVZwBYF3d99mY="; }; - propagatedBuildInputs = [ django djangorestframework six ]; + postPatch = '' + substituteInPlace setup.py \ + --replace "djangorestframework-jwt" "drf-jwt" + ''; - # pypi release does not include tests + propagatedBuildInputs = [ + django + djangorestframework + six + ]; + + checkInputs = [ + django-allauth + drf-jwt + responses + ]; + + # tests are icnompatible with current django version doCheck = false; + pythonImportsCheck = [ "rest_auth" ]; + meta = with lib; { description = "Django app that makes registration and authentication easy"; homepage = "https://github.com/Tivix/django-rest-auth"; license = licenses.mit; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ SuperSandro2000 ]; }; }