summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pynamodb/default.nix
blob: bd4b41bae52931406ada2e24f6ceaa67ceb8a840 (plain)
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
{
  lib,
  blinker,
  botocore,
  buildPythonPackage,
  fetchFromGitHub,
  freezegun,
  pytest-env,
  pytest-mock,
  pytestCheckHook,
  pythonOlder,
  setuptools,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "pynamodb";
  version = "6.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pynamodb";
    repo = "PynamoDB";
    tag = version;
    hash = "sha256-i4oxZO3gBVc2PMFSISeytaO8YrzYR9YuUMxrEqrg2c4=";
  };

  build-system = [ setuptools ];

  dependencies = [ botocore ] ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ];

  optional-dependencies = {
    signal = [ blinker ];
  };

  nativeCheckInputs = [
    freezegun
    pytest-env
    pytest-mock
    pytestCheckHook
  ]
  ++ optional-dependencies.signal;

  pythonImportsCheck = [ "pynamodb" ];

  disabledTests = [
    # Tests requires credentials or network access
    "test_binary_attribute_update"
    "test_binary_set_attribute_update"
    "test_connection_integration"
    "test_make_api_call__happy_path"
    "test_model_integration"
    "test_sign_request"
    "test_table_integration"
    "test_transact"
    # require a local dynamodb instance
    "test_create_table"
    "test_create_table__incompatible_indexes"
    # https://github.com/pynamodb/PynamoDB/issues/1265
    "test_connection_make_api_call__binary_attributes"
  ];

  meta = {
    description = "Interface for Amazon’s DynamoDB";
    longDescription = ''
      DynamoDB is a great NoSQL service provided by Amazon, but the API is
      verbose. PynamoDB presents you with a simple, elegant API.
    '';
    homepage = "http://jlafon.io/pynamodb.html";
    changelog = "https://github.com/pynamodb/PynamoDB/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}