about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnthony Roussel <anthony@roussel.dev>2022-10-25 21:34:08 +0200
committerGitHub <noreply@github.com>2022-10-25 21:34:08 +0200
commit3689a76637f9b233529ec79d0927142ff28b0a5a (patch)
tree1f5b120ba9bdd99fa4e2fb7c2c5f91d9d4edf5b7
parent00798308885d76d2ce0c2b92572d0791eb540cb2 (diff)
awscli2: 2.7.33 -> 2.8.5 (#197270)
-rw-r--r--pkgs/tools/admin/awscli2/default.nix72
1 files changed, 53 insertions, 19 deletions
diff --git a/pkgs/tools/admin/awscli2/default.nix b/pkgs/tools/admin/awscli2/default.nix
index a8623ced3782e..f5d909d252596 100644
--- a/pkgs/tools/admin/awscli2/default.nix
+++ b/pkgs/tools/admin/awscli2/default.nix
@@ -3,7 +3,9 @@
 , groff
 , less
 , fetchFromGitHub
+, nix-update-script
 }:
+
 let
   py = python3.override {
     packageOverrides = self: super: {
@@ -12,7 +14,16 @@ let
         src = self.fetchPypi {
           inherit (oldAttrs) pname;
           inherit version;
-          sha256 = "sha256-MGLTFcsWVC/gTdgjny6LwyOO6QRc1QcLkVzy677Lqqw=";
+          hash = "sha256-MGLTFcsWVC/gTdgjny6LwyOO6QRc1QcLkVzy677Lqqw=";
+        };
+      });
+
+      prompt-toolkit = super.prompt-toolkit.overridePythonAttrs (oldAttrs: rec {
+        version = "3.0.28";
+        src = self.fetchPypi {
+          pname = "prompt_toolkit";
+          inherit version;
+          hash = "sha256-nxzRax6GwpaPJRnX+zHdnWaZFvUVYSwmnRTp7VK1FlA=";
         };
       });
     };
@@ -21,15 +32,20 @@ let
 in
 with py.pkgs; buildPythonApplication rec {
   pname = "awscli2";
-  version = "2.7.33"; # N.B: if you change this, check if overrides are still up-to-date
+  version = "2.8.5"; # N.B: if you change this, check if overrides are still up-to-date
+  format = "pyproject";
 
   src = fetchFromGitHub {
     owner = "aws";
     repo = "aws-cli";
     rev = version;
-    sha256 = "sha256-9X056Xc9DPp8BiuAeCvQrswcj7mnZKrkMOad5aP1TI8=";
+    sha256 = "sha256-il5vUTHRTb1Y2ofu5z8W/8S39KRmRgKXVZs1f1T8YAg=";
   };
 
+  nativeBuildInputs = [
+    flit-core
+  ];
+
   propagatedBuildInputs = [
     awscrt
     bcdoc
@@ -53,25 +69,14 @@ with py.pkgs; buildPythonApplication rec {
     jsonschema
     mock
     pytestCheckHook
-    pytest-xdist
   ];
 
   postPatch = ''
-    substituteInPlace setup.cfg \
+    substituteInPlace pyproject.toml \
       --replace "colorama>=0.2.5,<0.4.4" "colorama" \
-      --replace "cryptography>=3.3.2,<37.0.0" "cryptography" \
+      --replace "distro>=1.5.0,<1.6.0" "distro" \
       --replace "docutils>=0.10,<0.16" "docutils" \
-      --replace "ruamel.yaml>=0.15.0,<=0.17.21" "ruamel.yaml" \
-      --replace "wcwidth<0.2.0" "wcwidth" \
-      --replace "prompt-toolkit>=3.0.24,<3.0.29" "prompt-toolkit~=3.0" \
-      --replace "distro>=1.5.0,<1.6.0" "distro"
-  '';
-
-  checkPhase = ''
-    export PATH=$PATH:$out/bin
-
-    # https://github.com/NixOS/nixpkgs/issues/16144#issuecomment-225422439
-    export HOME=$TMP
+      --replace "wcwidth<0.2.0" "wcwidth"
   '';
 
   postInstall = ''
@@ -87,13 +92,42 @@ with py.pkgs; buildPythonApplication rec {
     rm $out/bin/aws.cmd
   '';
 
-  passthru.python = py; # for aws_shell
+  doCheck = true;
+
+  preCheck = ''
+    export PATH=$PATH:$out/bin
+    export HOME=$(mktemp -d)
+  '';
+
+  pytestFlagsArray = [
+    "-Wignore::DeprecationWarning"
+  ];
+
+  disabledTestPaths = [
+    # Integration tests require networking
+    "tests/integration"
+
+    # Disable slow tests (only run unit tests)
+    "tests/backends"
+    "tests/functional"
+  ];
+
+  pythonImportsCheck = [
+    "awscli"
+  ];
+
+  passthru = {
+    python = py; # for aws_shell
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
 
   meta = with lib; {
     homepage = "https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html";
     changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
     description = "Unified tool to manage your AWS services";
     license = licenses.asl20;
-    maintainers = with maintainers; [ bhipple davegallant bryanasdev000 devusb ];
+    maintainers = with maintainers; [ bhipple davegallant bryanasdev000 devusb anthonyroussel ];
   };
 }