1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonRelaxDepsHook,
6
7 # propagates
8 django,
9 jwcrypto,
10 requests,
11 oauthlib,
12
13 # tests
14 djangorestframework,
15 pytest-django,
16 pytest-xdist,
17 pytest-mock,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "django-oauth-toolkit";
23 version = "2.3.0";
24 format = "setuptools";
25
26 src = fetchFromGitHub {
27 owner = "jazzband";
28 repo = pname;
29 rev = "refs/tags/${version}";
30 hash = "sha256-oGg5MD9p4PSUVkt5pGLwjAF4SHHf4Aqr+/3FsuFaybY=";
31 };
32
33 postPatch = ''
34 sed -i '/cov/d' tox.ini
35 '';
36
37 propagatedBuildInputs = [
38 django
39 jwcrypto
40 oauthlib
41 requests
42 ];
43
44 nativeBuildInputs = [ pythonRelaxDepsHook ];
45 pythonRelaxDeps = [ "django" ];
46
47 DJANGO_SETTINGS_MODULE = "tests.settings";
48
49 # xdist is disabled right now because it can cause race conditions on high core machines
50 # https://github.com/jazzband/django-oauth-toolkit/issues/1300
51 nativeCheckInputs = [
52 djangorestframework
53 pytest-django
54 # pytest-xdist
55 pytest-mock
56 pytestCheckHook
57 ];
58
59 disabledTests = [
60 # Failed to get a valid response from authentication server. Status code: 404, Reason: Not Found.
61 "test_response_when_auth_server_response_return_404"
62 ];
63
64 meta = with lib; {
65 description = "OAuth2 goodies for the Djangonauts";
66 homepage = "https://github.com/jazzband/django-oauth-toolkit";
67 license = licenses.bsd2;
68 maintainers = with maintainers; [ mmai ];
69 };
70}