1{
2 lib,
3 boto3,
4 buildPythonPackage,
5 envs,
6 fetchFromGitHub,
7 freezegun,
8 mock,
9 moto,
10 pyjwt,
11 pytestCheckHook,
12 pythonOlder,
13 requests,
14 requests-mock,
15 setuptools,
16}:
17
18buildPythonPackage rec {
19 pname = "pycognito";
20 version = "2024.5.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "pvizeli";
27 repo = "pycognito";
28 tag = version;
29 hash = "sha256-U23fFLru4j6GnWMcYtsCW9BVJkVcCoefPH6oMijYGew=";
30 };
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 boto3
36 envs
37 pyjwt
38 requests
39 ]
40 ++ pyjwt.optional-dependencies.crypto;
41
42 nativeCheckInputs = [
43 freezegun
44 mock
45 moto
46 pytestCheckHook
47 requests-mock
48 ]
49 ++ moto.optional-dependencies.cognitoidp;
50
51 enabledTestPaths = [ "tests.py" ];
52
53 disabledTests = [
54 # Test requires network access
55 "test_srp_requests_http_auth"
56 ];
57
58 pythonImportsCheck = [ "pycognito" ];
59
60 meta = with lib; {
61 description = "Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support";
62 homepage = "https://github.com/pvizeli/pycognito";
63 changelog = "https://github.com/NabuCasa/pycognito/releases/tag/${version}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ mic92 ];
66 };
67}