From 68eb7fdd62ac795260ba6d838522750ef5551397 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 26 Mar 2022 23:50:39 -0400 Subject: [PATCH 1/2] s3-credentials: init at 0.10 --- .../python-modules/s3-credentials/default.nix | 43 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/s3-credentials/default.nix diff --git a/pkgs/development/python-modules/s3-credentials/default.nix b/pkgs/development/python-modules/s3-credentials/default.nix new file mode 100644 index 000000000000..61af119aaaa8 --- /dev/null +++ b/pkgs/development/python-modules/s3-credentials/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, click +, click-default-group +, boto3 +, pytestCheckHook +, hypothesis +, pytest-mock +}: + +buildPythonPackage rec { + pname = "s3-credentials"; + version = "0.10"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "${pname}"; + rev = "${version}"; + sha256 = "sha256-JgqKmZG3K4JwQ1Bzw2oll/LQ1njA9wFhX0/uYr9XjAU="; + }; + + propagatedBuildInputs = [ + click + click-default-group + boto3 + ]; + + checkInputs = [ + pytestCheckHook + hypothesis + pytest-mock + ]; + + meta = with lib; { + description = "Python CLI utility for creating credentials for accessing S3 buckets"; + homepage = "https://github.com/simonw/s3-credentials"; + license = licenses.asl20; + maintainers = with maintainers; [ techknowlogick ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 40672ae4dd5b..198fb2c77341 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9696,6 +9696,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; + s3-credentials = with python3Packages; toPythonApplication s3-credentials; + s4cmd = callPackage ../tools/networking/s4cmd { }; s5cmd = callPackage ../tools/networking/s5cmd { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 748ad91c9f5c..dcf5a5983e64 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8944,6 +8944,8 @@ in { s3transfer = callPackage ../development/python-modules/s3transfer { }; + s3-credentials = callPackage ../development/python-modules/s3-credentials { }; + sabyenc3 = callPackage ../development/python-modules/sabyenc3 { }; sabyenc = callPackage ../development/python-modules/sabyenc { }; From c5914daa9f80bef4669909f5d9879c2869c67dad Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 28 Mar 2022 08:56:19 +0200 Subject: [PATCH 2/2] python3Packages.s3-credentials: add pythonImportsCheck --- .../python-modules/s3-credentials/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/s3-credentials/default.nix b/pkgs/development/python-modules/s3-credentials/default.nix index 61af119aaaa8..dd142cd09c79 100644 --- a/pkgs/development/python-modules/s3-credentials/default.nix +++ b/pkgs/development/python-modules/s3-credentials/default.nix @@ -13,13 +13,15 @@ buildPythonPackage rec { pname = "s3-credentials"; version = "0.10"; + format = "setuptools"; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "simonw"; - repo = "${pname}"; - rev = "${version}"; - sha256 = "sha256-JgqKmZG3K4JwQ1Bzw2oll/LQ1njA9wFhX0/uYr9XjAU="; + repo = pname; + rev = version; + hash = "sha256-JgqKmZG3K4JwQ1Bzw2oll/LQ1njA9wFhX0/uYr9XjAU="; }; propagatedBuildInputs = [ @@ -34,6 +36,10 @@ buildPythonPackage rec { pytest-mock ]; + pythonImportsCheck = [ + "s3_credentials" + ]; + meta = with lib; { description = "Python CLI utility for creating credentials for accessing S3 buckets"; homepage = "https://github.com/simonw/s3-credentials";