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