nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 boto3,
4 buildPythonPackage,
5 envs,
6 fetchFromGitHub,
7 freezegun,
8 mock,
9 moto,
10 pyjwt,
11 pytestCheckHook,
12 requests,
13 requests-mock,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "pycognito";
19 version = "2024.5.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "pvizeli";
24 repo = "pycognito";
25 tag = version;
26 hash = "sha256-U23fFLru4j6GnWMcYtsCW9BVJkVcCoefPH6oMijYGew=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 boto3
33 envs
34 pyjwt
35 requests
36 ]
37 ++ pyjwt.optional-dependencies.crypto;
38
39 nativeCheckInputs = [
40 freezegun
41 mock
42 moto
43 pytestCheckHook
44 requests-mock
45 ]
46 ++ moto.optional-dependencies.cognitoidp;
47
48 enabledTestPaths = [ "tests.py" ];
49
50 disabledTests = [
51 # Test requires network access
52 "test_srp_requests_http_auth"
53 ];
54
55 pythonImportsCheck = [ "pycognito" ];
56
57 meta = {
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 changelog = "https://github.com/NabuCasa/pycognito/releases/tag/${version}";
61 license = lib.licenses.asl20;
62 maintainers = with lib.maintainers; [ mic92 ];
63 };
64}