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: {
|
2022-10-30 15:09:59 +00:00
|
|
|
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";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "2.11.0"; # 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;
|
2023-03-08 16:32:21 +00:00
|
|
|
hash = "sha256-i5ZGq51ZKEkyt6+d/Q4NzGS/zEaoqNql2IPZ2xlTV6k=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "distro>=1.5.0,<1.6.0" "distro>=1.5.0" \
|
|
|
|
--replace "cryptography>=3.3.2,<38.0.5" "cryptography>=3.3.2"
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
jsonschema
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
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 {
|
2022-12-28 21:21:41 +00:00
|
|
|
# Excludes 1.x versions from the Github tags list
|
|
|
|
extraArgs = [ "--version-regex" "^(2\.(.*))" ];
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
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
|
|
|
};
|
|
|
|
}
|