1{
2 lib,
3 blinker,
4 botocore,
5 buildPythonPackage,
6 fetchFromGitHub,
7 freezegun,
8 pytest-env,
9 pytest-mock,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13 typing-extensions,
14}:
15
16buildPythonPackage rec {
17 pname = "pynamodb";
18 version = "6.1.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "pynamodb";
25 repo = "PynamoDB";
26 tag = version;
27 hash = "sha256-i4oxZO3gBVc2PMFSISeytaO8YrzYR9YuUMxrEqrg2c4=";
28 };
29
30 build-system = [ setuptools ];
31
32 dependencies = [ botocore ] ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ];
33
34 optional-dependencies = {
35 signal = [ blinker ];
36 };
37
38 nativeCheckInputs = [
39 freezegun
40 pytest-env
41 pytest-mock
42 pytestCheckHook
43 ]
44 ++ optional-dependencies.signal;
45
46 pythonImportsCheck = [ "pynamodb" ];
47
48 disabledTests = [
49 # Tests requires credentials or network access
50 "test_binary_attribute_update"
51 "test_binary_set_attribute_update"
52 "test_connection_integration"
53 "test_make_api_call__happy_path"
54 "test_model_integration"
55 "test_sign_request"
56 "test_table_integration"
57 "test_transact"
58 # require a local dynamodb instance
59 "test_create_table"
60 "test_create_table__incompatible_indexes"
61 # https://github.com/pynamodb/PynamoDB/issues/1265
62 "test_connection_make_api_call__binary_attributes"
63 ];
64
65 meta = with lib; {
66 description = "Interface for Amazon’s DynamoDB";
67 longDescription = ''
68 DynamoDB is a great NoSQL service provided by Amazon, but the API is
69 verbose. PynamoDB presents you with a simple, elegant API.
70 '';
71 homepage = "http://jlafon.io/pynamodb.html";
72 changelog = "https://github.com/pynamodb/PynamoDB/releases/tag/${src.tag}";
73 license = licenses.mit;
74 maintainers = [ ];
75 };
76}