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 ] ++ pyjwt.optional-dependencies.crypto;
40
41 nativeCheckInputs = [
42 freezegun
43 mock
44 moto
45 pytestCheckHook
46 requests-mock
47 ] ++ moto.optional-dependencies.cognitoidp;
48
49 pytestFlagsArray = [ "tests.py" ];
50
51 disabledTests = [
52 # Test requires network access
53 "test_srp_requests_http_auth"
54 ];
55
56 pythonImportsCheck = [ "pycognito" ];
57
58 meta = with lib; {
59 description = "Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support";
60 homepage = "https://github.com/pvizeli/pycognito";
61 changelog = "https://github.com/NabuCasa/pycognito/releases/tag/${version}";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ mic92 ];
64 };
65}