From 16b86120168543ad15050eea8625c4433a069733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 2 Jan 2022 00:24:15 +0000 Subject: [PATCH 1/3] awscli: pin pyyaml --- pkgs/tools/admin/awscli/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix index 754b2e8cea6a..065012cb7f8e 100644 --- a/pkgs/tools/admin/awscli/default.nix +++ b/pkgs/tools/admin/awscli/default.nix @@ -1,5 +1,6 @@ { lib , python3 +, fetchFromGitHub , groff , less }: @@ -14,6 +15,20 @@ let sha256 = "189n8hpijy14jfan4ha9f5n06mnl33cxz7ay92wjqgkr639s0vg9"; }; }); + pyyaml = super.pyyaml.overridePythonAttrs (oldAttrs: rec { + version = "5.4.1"; + src = fetchFromGitHub { + owner = "yaml"; + repo = "pyyaml"; + rev = version; + hash = "sha256-VUqnlOF/8zSOqh6JoEYOsfQ0P4g+eYqxyFTywgCS7gM="; + }; + checkPhase = '' + runHook preCheck + PYTHONPATH="tests/lib3:$PYTHONPATH" ${self.python.interpreter} -m test_all + runHook postCheck + ''; + }); }; }; From 482634d5ca393aac313daee6a42b3ffc6454bc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 2 Jan 2022 00:24:45 +0000 Subject: [PATCH 2/3] awscli: 1.22.14 -> 1.22.21 --- pkgs/tools/admin/awscli/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix index 065012cb7f8e..49762e3278c8 100644 --- a/pkgs/tools/admin/awscli/default.nix +++ b/pkgs/tools/admin/awscli/default.nix @@ -35,11 +35,11 @@ let in with py.pkgs; buildPythonApplication rec { pname = "awscli"; - version = "1.22.14"; # N.B: if you change this, change botocore and boto3 to a matching version too + version = "1.22.21"; # N.B: if you change this, change botocore and boto3 to a matching version too src = fetchPypi { inherit pname version; - sha256 = "sha256-FTGtUqdjZel8XqSrO3s3XQNqR6fyTO3mc1gyIQfk9n8="; + hash = "sha256-yzfy6MjXC6LeydLNVXQvcK4UmpVQP/jJ+W2jMgpNMgw="; }; # https://github.com/aws/aws-cli/issues/4837 From 741668e4b0d5ae964d3fb42399cebab6078f4524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 2 Jan 2022 21:48:15 +0000 Subject: [PATCH 3/3] nimbo: add awscli to $PATH instead of propagatedBuildInputs Awscli is never imported. --- pkgs/applications/misc/nimbo/default.nix | 33 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/nimbo/default.nix b/pkgs/applications/misc/nimbo/default.nix index 802a9f9a32c1..8af9d1471a08 100644 --- a/pkgs/applications/misc/nimbo/default.nix +++ b/pkgs/applications/misc/nimbo/default.nix @@ -1,11 +1,14 @@ -{ lib, setuptools, boto3, requests, click, pyyaml, pydantic -, buildPythonApplication, pythonOlder, installShellFiles, fetchFromGitHub -, awscli }: +{ lib +, python3 +, fetchFromGitHub +, installShellFiles +, awscli +}: -buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "nimbo"; version = "0.2.4"; - disabled = pythonOlder "3.6"; + disabled = python3.pythonOlder "3.6"; src = fetchFromGitHub { owner = "nimbo-sh"; @@ -13,13 +16,31 @@ buildPythonApplication rec { rev = "v${version}"; sha256 = "1fs28s9ynfxrb4rzba6cmik0kl0q0vkpb4zdappsq62jqf960k24"; }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "awscli>=1.19<2.0" "" + ''; + nativeBuildInputs = [ installShellFiles ]; - propagatedBuildInputs = [ setuptools boto3 awscli requests click pyyaml pydantic ]; + + propagatedBuildInputs = with python3.pkgs; [ + setuptools + boto3 + requests + click + pyyaml + pydantic + ]; # nimbo tests require an AWS instance doCheck = false; pythonImportsCheck = [ "nimbo" ]; + makeWrapperArgs = [ + "--prefix" "PATH" ":" (lib.makeBinPath [ awscli ]) + ]; + postInstall = '' installShellCompletion --cmd nimbo \ --zsh <(_NIMBO_COMPLETE=source_zsh $out/bin/nimbo) \