1{
2 lib,
3 blinker,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 mock,
8 pyjwt,
9 pytestCheckHook,
10 setuptools,
11
12 # for passthru.tests
13 django-allauth,
14 django-oauth-toolkit,
15 google-auth-oauthlib,
16 requests-oauthlib,
17}:
18
19buildPythonPackage rec {
20 pname = "oauthlib";
21 version = "3.3.1";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "oauthlib";
26 repo = "oauthlib";
27 tag = "v${version}";
28 hash = "sha256-ZTmR+pTNQaRQMnUA+8hXM5VACRd8Hn62KTNooy5FQyk=";
29 };
30
31 nativeBuildInputs = [ setuptools ];
32
33 optional-dependencies = {
34 rsa = [ cryptography ];
35 signedtoken = [
36 cryptography
37 pyjwt
38 ];
39 signals = [ blinker ];
40 };
41
42 nativeCheckInputs = [
43 mock
44 pytestCheckHook
45 ]
46 ++ lib.flatten (lib.attrValues optional-dependencies);
47
48 disabledTests = [
49 # too narrow time comparison issues
50 "test_fetch_access_token"
51 ];
52
53 pythonImportsCheck = [ "oauthlib" ];
54
55 passthru.tests = {
56 inherit
57 django-allauth
58 django-oauth-toolkit
59 google-auth-oauthlib
60 requests-oauthlib
61 ;
62 };
63
64 meta = with lib; {
65 changelog = "https://github.com/oauthlib/oauthlib/blob/${src.tag}/CHANGELOG.rst";
66 description = "Generic, spec-compliant, thorough implementation of the OAuth request-signing logic";
67 homepage = "https://github.com/oauthlib/oauthlib";
68 license = licenses.bsd3;
69 maintainers = with maintainers; [ prikhi ];
70 };
71}