about summary refs log tree commit diff
path: root/pkgs/development/python-modules/aws-secretsmanager-caching/default.nix
blob: daf6adf4f00ce5e7db4f8602f032eccc6b69304e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
  lib,
  botocore,
  buildPythonPackage,
  fetchPypi,
  pytestCheckHook,
  pythonAtLeast,
  pythonOlder,
  setuptools,
  setuptools-scm,
}:

buildPythonPackage rec {
  pname = "aws-secretsmanager-caching";
  version = "1.1.3";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "aws_secretsmanager_caching";
    inherit version;
    hash = "sha256-9tbsnUPg2+T21d6982tMtpHRWpZ7NYsldfXZGXSmwP8=";
  };

  patches = [
    # Remove coverage tests from the pytest invocation in setup.cfg.
    ./remove-coverage-tests.patch
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail "'pytest-runner'," ""
  '';

  build-system = [ setuptools-scm ];

  dependencies = [
    botocore
    setuptools # Needs pkg_resources at runtime.
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  disabledTestPaths = [
    # Integration tests require networking.
    "test/integ"
  ];

  disabledTests = lib.optionals (pythonAtLeast "3.12") [
    # TypeError: 'float' object cannot be interpreted as an integer
    "test_calls_hook_binary"
    "test_calls_hook_string"
    "test_get_secret_binary"
    "test_get_secret_string"
    "test_invalid_json"
    "test_missing_key"
    "test_string_with_additional_kwargs"
    "test_string"
    "test_valid_json_with_mixed_args"
    "test_valid_json_with_no_secret_kwarg"
    "test_valid_json"
  ];

  pythonImportsCheck = [ "aws_secretsmanager_caching" ];

  meta = with lib; {
    description = "Client-side AWS secrets manager caching library";
    homepage = "https://github.com/aws/aws-secretsmanager-caching-python";
    changelog = "https://github.com/aws/aws-secretsmanager-caching-python/releases/tag/v${version}";
    longDescription = ''
      The AWS Secrets Manager Python caching client enables in-process caching of secrets for Python applications.
    '';
    license = licenses.asl20;
    maintainers = with maintainers; [ tomaskala ];
  };
}