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 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
61
62 disabledTests = [
63 # Tests are outdated, https://github.com/jupyterhub/oauthenticator/issues/432
64 "test_azuread"
65 "test_mediawiki"
66 # Tests require network access
67 "test_allowed"
68 "test_auth0"
69 "test_bitbucket"
70 "test_cilogon"
71 "test_github"
72 "test_gitlab"
73 "test_globus"
74 "test_google"
75 "test_openshift"
76 ];
77
78 pythonImportsCheck = [ "oauthenticator" ];
79
80 meta = with lib; {
81 description = "Authenticate JupyterHub users with common OAuth providers";
82 homepage = "https://github.com/jupyterhub/oauthenticator";
83 changelog = "https://github.com/jupyterhub/oauthenticator/blob/${version}/docs/source/reference/changelog.md";
84 license = licenses.bsd3;
85 maintainers = [ ];
86 };
87}