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 = "14.0.0";
18 disabled = pythonOlder "3.6";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "1zfcl3dq9ladqg7fnpx6kgxf1ckjzlc8v3j6wa8w6iwglm40ax4r";
23 };
24
25 propagatedBuildInputs = [
26 jupyterhub
27 ];
28
29 checkInputs = [
30 google-api-python-client
31 google-auth-oauthlib
32 mwoauth
33 pyjwt
34 pytest-asyncio
35 pytestCheckHook
36 requests-mock
37 ];
38
39 postPatch = ''
40 # The constraint was removed. No longer needed for > 14.0.0
41 # https://github.com/jupyterhub/oauthenticator/pull/431
42 substituteInPlace test-requirements.txt --replace "pyjwt>=1.7,<2.0" "pyjwt"
43 '';
44
45 disabledTests = [
46 # Test are outdated, https://github.com/jupyterhub/oauthenticator/issues/432
47 "test_azuread"
48 "test_mediawiki"
49 ];
50
51 pythonImportsCheck = [ "oauthenticator" ];
52
53 meta = with lib; {
54 description = "Authenticate JupyterHub users with common OAuth providers, including GitHub, Bitbucket, and more.";
55 homepage = "https://github.com/jupyterhub/oauthenticator";
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ ixxie ];
58 };
59}