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 = "2023.5.0";
19 disabled = isPy27;
20
21 src = fetchFromGitHub {
22 owner = "pvizeli";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-2Aqid2bd5BAnWQ+Wtji0zXjLAmSpyJNGqJ0VroGi6lY=";
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 disabledTests = [
51 # requires network access
52 "test_srp_requests_http_auth"
53 ];
54
55 pythonImportsCheck = [ "pycognito" ];
56
57 meta = with lib; {
58 description = "Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support";
59 homepage = "https://github.com/pvizeli/pycognito";
60 license = licenses.asl20;
61 maintainers = with maintainers; [ mic92 ];
62 };
63}