Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / dj-rest-auth / default.nix
blobe415977d86374b503c29a945fd4ef3845bf0f06c
1 { lib
2 , buildPythonPackage
3 , django
4 , django-allauth
5 , djangorestframework
6 , djangorestframework-simplejwt
7 , fetchFromGitHub
8 , fetchpatch
9 , python
10 , pythonOlder
11 , responses
12 , setuptools
13 , unittest-xml-reporting
16 buildPythonPackage rec {
17   pname = "dj-rest-auth";
18   version = "5.0.2";
19   pyproject = true;
21   disabled = pythonOlder "3.6";
23   src = fetchFromGitHub {
24     owner = "iMerica";
25     repo = "dj-rest-auth";
26     rev = "refs/tags/${version}";
27     hash = "sha256-TqeNpxXn+v89fEiJ4AVNhp8blCfYQKFQfYmZ6/QlRbQ=";
28   };
30   patches = [
31     # https://github.com/iMerica/dj-rest-auth/pull/597
32     (fetchpatch {
33       name = "disable-email-confirmation-ratelimit-in-tests-to-support-new-allauth.patch";
34       url = "https://github.com/iMerica/dj-rest-auth/commit/c8f19e18a93f4959da875f9c5cdd32f7d9363bba.patch";
35       hash = "sha256-Y/YBjV+c5Gw1wMR5r/4VnyV/ewUVG0z4pjY/MB4ca9Y=";
36     })
37   ];
39   postPatch = ''
40     substituteInPlace setup.py \
41       --replace "==" ">="
42   '';
44   nativeBuildInputs = [
45     setuptools
46   ];
48   buildInputs = [
49     django
50   ];
52   propagatedBuildInputs = [
53     djangorestframework
54   ];
56   passthru.optional-dependencies.with_social = [
57     django-allauth
58   ];
60   nativeCheckInputs = [
61     djangorestframework-simplejwt
62     responses
63     unittest-xml-reporting
64   ] ++ passthru.optional-dependencies.with_social;
66   preCheck = ''
67     # Test connects to graph.facebook.com
68     substituteInPlace dj_rest_auth/tests/test_serializers.py \
69       --replace "def test_http_error" "def dont_test_http_error"
70   '';
72   checkPhase = ''
73     runHook preCheck
74     ${python.interpreter} runtests.py
75     runHook postCheck
76   '';
78   pythonImportsCheck = [
79     "dj_rest_auth"
80   ];
82   meta = with lib; {
83     description = "Authentication for Django Rest Framework";
84     homepage = "https://github.com/iMerica/dj-rest-auth";
85     changelog = "https://github.com/iMerica/dj-rest-auth/releases/tag/${version}";
86     license = licenses.mit;
87     maintainers = with maintainers; [ ];
88   };