1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 google-api-python-client,
7 google-auth-oauthlib,
8 jsonschema,
9 jupyterhub,
10 mwoauth,
11 pyjwt,
12 pytest-asyncio,
13 pytest-cov-stub,
14 pytestCheckHook,
15 requests,
16 requests-mock,
17 ruamel-yaml,
18 setuptools,
19 tornado,
20 traitlets,
21}:
22
23buildPythonPackage rec {
24 pname = "oauthenticator";
25 version = "17.3.0";
26 pyproject = true;
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchPypi {
31 inherit pname version;
32 hash = "sha256-5dkMskEf/z3G/MFjNGgjPA4OAjlCLAh8dzTRaFBVuPM=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 jsonschema
39 jupyterhub
40 pyjwt
41 requests
42 ruamel-yaml
43 tornado
44 traitlets
45 ];
46
47 optional-dependencies = {
48 googlegroups = [
49 google-api-python-client
50 google-auth-oauthlib
51 ];
52 mediawiki = [ mwoauth ];
53 };
54
55 nativeCheckInputs = [
56 pytest-asyncio
57 pytest-cov-stub
58 pytestCheckHook
59 requests-mock
60 ]
61 ++ lib.flatten (builtins.attrValues optional-dependencies);
62
63 disabledTests = [
64 # Tests are outdated, https://github.com/jupyterhub/oauthenticator/issues/432
65 "test_azuread"
66 "test_mediawiki"
67 # Tests require network access
68 "test_allowed"
69 "test_auth0"
70 "test_bitbucket"
71 "test_cilogon"
72 "test_github"
73 "test_gitlab"
74 "test_globus"
75 "test_google"
76 "test_openshift"
77 ];
78
79 pythonImportsCheck = [ "oauthenticator" ];
80
81 meta = with lib; {
82 description = "Authenticate JupyterHub users with common OAuth providers";
83 homepage = "https://github.com/jupyterhub/oauthenticator";
84 changelog = "https://github.com/jupyterhub/oauthenticator/blob/${version}/docs/source/reference/changelog.md";
85 license = licenses.bsd3;
86 maintainers = [ ];
87 };
88}