From 38bc0c155d333261db0ca0db6cd9b7b726c2d017 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 3 Mar 2023 20:01:41 +0100 Subject: [PATCH] python310Packages.dj-rest-auth: Disable failing test Run test phase explicitly, pass django as build input, expose optional-dependencies. --- .../python-modules/dj-rest-auth/default.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/dj-rest-auth/default.nix b/pkgs/development/python-modules/dj-rest-auth/default.nix index b04dc05e9237..3f480b1d716a 100644 --- a/pkgs/development/python-modules/dj-rest-auth/default.nix +++ b/pkgs/development/python-modules/dj-rest-auth/default.nix @@ -1,11 +1,13 @@ { lib , buildPythonPackage , fetchFromGitHub +, django , django-allauth , djangorestframework , djangorestframework-simplejwt , responses , unittest-xml-reporting +, python }: buildPythonPackage rec { @@ -25,16 +27,35 @@ buildPythonPackage rec { --replace "==" ">=" ''; + buildInputs = [ + django + ]; + propagatedBuildInputs = [ djangorestframework ]; - nativeCheckInputs = [ + passthru.optional-dependencies.with_social = [ django-allauth + ]; + + nativeCheckInputs = [ djangorestframework-simplejwt responses unittest-xml-reporting - ]; + ] ++ passthru.optional-dependencies.with_social; + + preCheck = '' + # connects to graph.facebook.com + substituteInPlace dj_rest_auth/tests/test_serializers.py \ + --replace "def test_http_error" "def dont_test_http_error" + ''; + + checkPhase = '' + runHook preCheck + ${python.interpreter} runtests.py + runHook postCheck + ''; pythonImportsCheck = [ "dj_rest_auth" ];