2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, groff
|
|
|
|
, less
|
|
|
|
, fetchFromGitHub
|
2022-10-30 15:09:59 +00:00
|
|
|
, nix-update-script
|
2022-11-27 09:42:12 +00:00
|
|
|
, testers
|
|
|
|
, awscli2
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
2022-10-30 15:09:59 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
let
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2021-09-18 10:52:07 +00:00
|
|
|
awscrt = super.awscrt.overridePythonAttrs (oldAttrs: rec {
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "0.14.0";
|
2021-09-18 10:52:07 +00:00
|
|
|
src = self.fetchPypi {
|
|
|
|
inherit (oldAttrs) pname;
|
|
|
|
inherit version;
|
2022-10-30 15:09:59 +00:00
|
|
|
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=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
});
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
with py.pkgs; buildPythonApplication rec {
|
|
|
|
pname = "awscli2";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "2.9.6"; # N.B: if you change this, check if overrides are still up-to-date
|
2022-10-30 15:09:59 +00:00
|
|
|
format = "pyproject";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws";
|
|
|
|
repo = "aws-cli";
|
|
|
|
rev = version;
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-3zB0Uy2pmkrOLb+/mXZGs/pnzo6zi2zVPyeNPGPVQJM=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
awscrt
|
2020-07-18 16:06:22 +00:00
|
|
|
bcdoc
|
|
|
|
colorama
|
|
|
|
cryptography
|
2020-08-20 17:08:02 +00:00
|
|
|
distro
|
2020-07-18 16:06:22 +00:00
|
|
|
docutils
|
|
|
|
groff
|
|
|
|
less
|
2021-08-05 21:33:18 +00:00
|
|
|
prompt-toolkit
|
2020-07-18 16:06:22 +00:00
|
|
|
pyyaml
|
|
|
|
rsa
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2022-04-27 09:35:20 +00:00
|
|
|
python-dateutil
|
|
|
|
jmespath
|
|
|
|
urllib3
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
checkInputs = [
|
|
|
|
jsonschema
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-12-17 10:02:37 +00:00
|
|
|
sed -i pyproject.toml \
|
|
|
|
-e 's/colorama.*/colorama",/' \
|
|
|
|
-e 's/cryptography.*/cryptography",/' \
|
|
|
|
-e 's/distro.*/distro",/'
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postInstall = ''
|
2020-11-24 20:58:05 +00:00
|
|
|
mkdir -p $out/${python3.sitePackages}/awscli/data
|
|
|
|
${python3.interpreter} scripts/gen-ac-index --index-location $out/${python3.sitePackages}/awscli/data/ac.index
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
mkdir -p $out/share/bash-completion/completions
|
2020-12-03 08:41:04 +00:00
|
|
|
echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/aws
|
2020-11-21 19:51:51 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
mkdir -p $out/share/zsh/site-functions
|
|
|
|
mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
|
2020-11-21 19:51:51 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
rm $out/bin/aws.cmd
|
|
|
|
'';
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
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;
|
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = awscli2;
|
|
|
|
command = "aws --version";
|
|
|
|
version = version;
|
|
|
|
};
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
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;
|
2022-10-30 15:09:59 +00:00
|
|
|
maintainers = with maintainers; [ bhipple davegallant bryanasdev000 devusb anthonyroussel ];
|
2022-11-27 09:42:12 +00:00
|
|
|
mainProgram = "aws";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|