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.0.1";
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-OcrES+1F95KjhRXpEukzbuDfTXU4hyJqxGjD1xMcdKE=";
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 ] ++ optional-dependencies.signal;
44
45 pythonImportsCheck = [ "pynamodb" ];
46
47 disabledTests = [
48 # Tests requires credentials or network access
49 "test_binary_attribute_update"
50 "test_binary_set_attribute_update"
51 "test_connection_integration"
52 "test_make_api_call__happy_path"
53 "test_model_integration"
54 "test_sign_request"
55 "test_table_integration"
56 "test_transact"
57 # require a local dynamodb instance
58 "test_create_table"
59 "test_create_table__incompatible_indexes"
60 ];
61
62 meta = with lib; {
63 description = "Interface for Amazon’s DynamoDB";
64 longDescription = ''
65 DynamoDB is a great NoSQL service provided by Amazon, but the API is
66 verbose. PynamoDB presents you with a simple, elegant API.
67 '';
68 homepage = "http://jlafon.io/pynamodb.html";
69 changelog = "https://github.com/pynamodb/PynamoDB/releases/tag/${version}";
70 license = licenses.mit;
71 maintainers = [ ];
72 };
73}