1{
2 lib,
3 botocore,
4 buildPythonPackage,
5 fetchPypi,
6 pytest-cov-stub,
7 pytestCheckHook,
8 pythonAtLeast,
9 pythonOlder,
10 setuptools,
11 setuptools-scm,
12}:
13
14buildPythonPackage rec {
15 pname = "aws-secretsmanager-caching";
16 version = "1.1.3";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 pname = "aws_secretsmanager_caching";
23 inherit version;
24 hash = "sha256-9tbsnUPg2+T21d6982tMtpHRWpZ7NYsldfXZGXSmwP8=";
25 };
26
27 postPatch = ''
28 substituteInPlace setup.py \
29 --replace-fail "'pytest-runner'," ""
30 '';
31
32 build-system = [ setuptools-scm ];
33
34 dependencies = [
35 botocore
36 setuptools # Needs pkg_resources at runtime.
37 ];
38
39 nativeCheckInputs = [
40 pytest-cov-stub
41 pytestCheckHook
42 ];
43
44 disabledTestPaths = [
45 # Integration tests require networking.
46 "test/integ"
47 ];
48
49 disabledTests = lib.optionals (pythonAtLeast "3.12") [
50 # TypeError: 'float' object cannot be interpreted as an integer
51 "test_calls_hook_binary"
52 "test_calls_hook_string"
53 "test_get_secret_binary"
54 "test_get_secret_string"
55 "test_invalid_json"
56 "test_missing_key"
57 "test_string_with_additional_kwargs"
58 "test_string"
59 "test_valid_json_with_mixed_args"
60 "test_valid_json_with_no_secret_kwarg"
61 "test_valid_json"
62 ];
63
64 pythonImportsCheck = [ "aws_secretsmanager_caching" ];
65
66 meta = with lib; {
67 description = "Client-side AWS secrets manager caching library";
68 homepage = "https://github.com/aws/aws-secretsmanager-caching-python";
69 changelog = "https://github.com/aws/aws-secretsmanager-caching-python/releases/tag/v${version}";
70 longDescription = ''
71 The AWS Secrets Manager Python caching client enables in-process caching of secrets for Python applications.
72 '';
73 license = licenses.asl20;
74 maintainers = with maintainers; [ tomaskala ];
75 };
76}