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