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.2.0";
23 format = "setuptools";
24
25 src = fetchFromGitHub {
26 owner = "jazzband";
27 repo = pname;
28 rev = "refs/tags/${version}";
29 sha256 = "sha256-mynchdvrfBGKMeFFb2oDaANhtSCxq85Nibx7GfSY2nQ=";
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 checkInputs = [
51 djangorestframework
52 pytest-django
53 pytest-xdist
54 pytest-mock
55 pytestCheckHook
56 ];
57
58 disabledTests = [
59 # Failed to get a valid response from authentication server. Status code: 404, Reason: Not Found.
60 "test_response_when_auth_server_response_return_404"
61 ];
62
63 meta = with lib; {
64 description = "OAuth2 goodies for the Djangonauts";
65 homepage = "https://github.com/jazzband/django-oauth-toolkit";
66 license = licenses.bsd2;
67 maintainers = with maintainers; [ mmai ];
68 };
69}