evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / aw / awscli / package.nix
blobe9b5af2c1b9d576d656714e799198fd576f144a2
1 { lib
2 , python3
3 , fetchPypi
4 , groff
5 , less
6 , nix-update-script
7 , testers
8 , awscli
9 }:
11 let
12   self = python3.pkgs.buildPythonApplication rec {
13     pname = "awscli";
14     # N.B: if you change this, change botocore and boto3 to a matching version too
15     # check e.g. https://github.com/aws/aws-cli/blob/1.33.21/setup.py
16     version = "1.34.30";
17     pyproject = true;
19     src = fetchPypi {
20       inherit pname version;
21       hash = "sha256-7RdAqXdCnS7dzkGQHJHclR2KuBbSbd+epGMQDbDlYxY=";
22     };
24     pythonRelaxDeps = [
25       # botocore must not be relaxed
26       "colorama"
27       "docutils"
28       "rsa"
29     ];
31     build-system = [
32       python3.pkgs.setuptools
33     ];
35     dependencies = with python3.pkgs; [
36       botocore
37       s3transfer
38       colorama
39       docutils
40       rsa
41       pyyaml
42       groff
43       less
44     ];
46     postInstall = ''
47       mkdir -p $out/share/bash-completion/completions
48       echo "complete -C $out/bin/aws_completer aws" > $out/share/bash-completion/completions/awscli
50       mkdir -p $out/share/zsh/site-functions
51       mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
53       rm $out/bin/aws.cmd
54     '';
56     doInstallCheck = true;
58     installCheckPhase = ''
59       runHook preInstallCheck
61       $out/bin/aws --version | grep "${python3.pkgs.botocore.version}"
62       $out/bin/aws --version | grep "${version}"
64       runHook postInstallCheck
65     '';
67     passthru = {
68       python = python3; # for aws_shell
69       updateScript = nix-update-script {
70         extraArgs = [ "--version=skip" ];
71       };
72       tests.version = testers.testVersion {
73         package = awscli;
74         command = "aws --version";
75         inherit version;
76       };
77     };
79     meta = {
80       homepage = "https://aws.amazon.com/cli/";
81       changelog = "https://github.com/aws/aws-cli/blob/${version}/CHANGELOG.rst";
82       description = "Unified tool to manage your AWS services";
83       license = lib.licenses.asl20;
84       mainProgram = "aws";
85       maintainers = with lib.maintainers; [ anthonyroussel ];
86     };
87   };
89 assert self ? pythonRelaxDeps -> !(lib.elem "botocore" self.pythonRelaxDeps);
90 self