1{ lib
2, boto3
3, buildPythonPackage
4, envs
5, fetchFromGitHub
6, isPy27
7, freezegun
8, mock
9, moto
10, pytestCheckHook
11, python-jose
12, requests
13, requests-mock
14}:
15
16buildPythonPackage rec {
17 pname = "pycognito";
18 version = "2022.12.0";
19 disabled = isPy27;
20
21 src = fetchFromGitHub {
22 owner = "pvizeli";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-WepDna9f3Z3dBxWdE6G7nbl3yPK5vMG+7X1rxbZwdjE=";
26 };
27
28 propagatedBuildInputs = [
29 boto3
30 envs
31 python-jose
32 requests
33 ];
34
35 nativeCheckInputs = [
36 freezegun
37 mock
38 moto
39 pytestCheckHook
40 requests-mock
41 ];
42
43 postPatch = ''
44 substituteInPlace setup.py \
45 --replace 'python-jose[cryptography]' 'python-jose'
46 '';
47
48 pytestFlagsArray = [ "tests.py" ];
49
50 pythonImportsCheck = [ "pycognito" ];
51
52 meta = with lib; {
53 description = "Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support";
54 homepage = "https://github.com/pvizeli/pycognito";
55 license = licenses.asl20;
56 maintainers = with maintainers; [ mic92 ];
57 };
58}