1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, google-api-python-client
6, google-auth-oauthlib
7, jupyterhub
8, mwoauth
9, pyjwt
10, pytest-asyncio
11, pytestCheckHook
12, requests-mock
13}:
14
15buildPythonPackage rec {
16 pname = "oauthenticator";
17 version = "16.1.1";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-Obv4MJvO7li+KqI2l6KxfxjpbZVD5KFJwjn/u+UtaQQ=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace " --cov=oauthenticator" ""
30 '';
31
32 propagatedBuildInputs = [
33 jupyterhub
34 ];
35
36 passthru.optional-dependencies = {
37 azuread = [
38 pyjwt
39 ];
40 googlegroups = [
41 google-api-python-client
42 google-auth-oauthlib
43 ];
44 mediawiki = [
45 mwoauth
46 ];
47 };
48
49 nativeCheckInputs = [
50 pytest-asyncio
51 pytestCheckHook
52 requests-mock
53 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
54
55 disabledTests = [
56 # Tests are outdated, https://github.com/jupyterhub/oauthenticator/issues/432
57 "test_azuread"
58 "test_mediawiki"
59 ];
60
61 pythonImportsCheck = [
62 "oauthenticator"
63 ];
64
65 meta = with lib; {
66 description = "Authenticate JupyterHub users with common OAuth providers";
67 homepage = "https://github.com/jupyterhub/oauthenticator";
68 changelog = "https://github.com/jupyterhub/oauthenticator/blob/${version}/docs/source/reference/changelog.md";
69 license = licenses.bsd3;
70 };
71}