From 99b1fb1c1f8791d3c98368e22cfe39fcb6b52e47 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 28 Oct 2022 00:58:04 +0000 Subject: [PATCH 1/2] python310Packages.pynamodb: 5.2.1 -> 5.2.3 --- pkgs/development/python-modules/pynamodb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pynamodb/default.nix b/pkgs/development/python-modules/pynamodb/default.nix index d3b39457438c..b0a83e293e52 100644 --- a/pkgs/development/python-modules/pynamodb/default.nix +++ b/pkgs/development/python-modules/pynamodb/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "pynamodb"; - version = "5.2.1"; + version = "5.2.3"; src = fetchPypi { inherit pname version; - sha256 = "sha256-x6nFV7UjZLwJJX7dADeO68dSWLvaoP4FD8ziNWFJ+Qo="; + sha256 = "sha256-lgGlHllIiwUy5RN9HJcMJT4XVKu6DihSQi6Usbfpp10="; }; propagatedBuildInputs = [ python-dateutil botocore ]; From 40362d20663ee5551b88d032b005709cc0ba1d98 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 28 Oct 2022 09:22:05 +0200 Subject: [PATCH 2/2] python310Packages.pynamodb: switch to pytestCheckHook - add pythonImportsCheck - disable on older Python releases - add optional-dependencies --- .../python-modules/pynamodb/default.nix | 61 +++++++++++++++---- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/pynamodb/default.nix b/pkgs/development/python-modules/pynamodb/default.nix index b0a83e293e52..4844ebee9990 100644 --- a/pkgs/development/python-modules/pynamodb/default.nix +++ b/pkgs/development/python-modules/pynamodb/default.nix @@ -1,33 +1,72 @@ { lib -, buildPythonPackage +, blinker , botocore -, fetchPypi -, mock -, mypy +, buildPythonPackage +, fetchFromGitHub +, pytest-mock +, pytestCheckHook , python-dateutil -, pytest +, pythonOlder , requests +, typing-extensions }: buildPythonPackage rec { pname = "pynamodb"; version = "5.2.3"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-lgGlHllIiwUy5RN9HJcMJT4XVKu6DihSQi6Usbfpp10="; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pynamodb"; + repo = "PynamoDB"; + rev = "refs/tags/${version}"; + sha256 = "sha256-3Si0BCMofr38OuXoX8Tj9n3ITv3rH5hNfDQZvZWk79o="; }; - propagatedBuildInputs = [ python-dateutil botocore ]; - checkInputs = [ requests mock pytest mypy ]; + propagatedBuildInputs = [ + python-dateutil + botocore + ] ++ lib.optionals (pythonOlder "3.8") [ + typing-extensions + ]; + + passthru.optional-dependencies = { + signal = [ + blinker + ]; + }; + + checkInputs = [ + pytest-mock + pytestCheckHook + ] ++ passthru.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" + ]; meta = with lib; { - description = "A Pythonic interface for Amazon’s DynamoDB that supports Python 2 and 3."; + 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"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; }