Unverified Commit 1732b6e2 authored by OTABI Tomoya's avatar OTABI Tomoya Committed by GitHub
Browse files

Merge pull request #310068 from natsukium/awscli/fix

awscli: sync with botocore
parents e1fce3f6 07566095
Loading
Loading
Loading
Loading
+70 −63
Original line number Diff line number Diff line
@@ -8,14 +8,19 @@
, awscli
}:

python3.pkgs.buildPythonApplication rec {
let
  botocoreVersion = python3.pkgs.botocore.version;
  # awscli.version should be pinned to 2 minor versions less than the botocoreVersion
  versionMinor = toString (lib.toInt (lib.versions.minor botocoreVersion) - 2);
  versionPatch = lib.versions.patch botocoreVersion;
  self = python3.pkgs.buildPythonApplication rec {
    pname = "awscli";
  version = "1.32.101"; # N.B: if you change this, change botocore and boto3 to a matching version too
    version = "1.${versionMinor}.${versionPatch}"; # N.B: if you change this, change botocore and boto3 to a matching version too
    pyproject = true;

    src = fetchPypi {
      inherit pname version;
    hash = "sha256-M4KzuQ+srPfk85P5QeQfVMorSKWhmNhdX4AY0AeRDTQ=";
      hash = "sha256-GPcXkl2H0XNaeqt2/qD5+KvW23dRB0X+zLWo9hLigQM=";
    };

    nativeBuildInputs = [
@@ -23,7 +28,7 @@ python3.pkgs.buildPythonApplication rec {
    ];

    pythonRelaxDeps = [
    "botocore"
      # botocore must not be relaxed
      "colorama"
      "docutils"
      "rsa"
@@ -59,7 +64,7 @@ python3.pkgs.buildPythonApplication rec {
    installCheckPhase = ''
      runHook preInstallCheck

    $out/bin/aws --version | grep "${python3.pkgs.botocore.version}"
      $out/bin/aws --version | grep "${botocoreVersion}"
      $out/bin/aws --version | grep "${version}"

      runHook postInstallCheck
@@ -68,8 +73,7 @@ python3.pkgs.buildPythonApplication rec {
    passthru = {
      python = python3; # for aws_shell
      updateScript = nix-update-script {
      # Excludes 1.x versions from the Github tags list
      extraArgs = [ "--version-regex" "^(1\.(.*))" ];
        extraArgs = [ "--version=skip" ];
      };
      tests.version = testers.testVersion {
        package = awscli;
@@ -86,4 +90,7 @@ python3.pkgs.buildPythonApplication rec {
      mainProgram = "aws";
      maintainers = with maintainers; [ anthonyroussel ];
    };
}
  };
in
assert self ? pythonRelaxDeps -> !(lib.elem "botocore" self.pythonRelaxDeps);
self