class Awscli < Formula include Language::Python::Virtualenv desc "Official Amazon AWS command-line interface" homepage "https://aws.amazon.com/cli/" url "https://github.com/aws/aws-cli/archive/1.11.57.tar.gz" sha256 "703c4c355d6d6339811247a8343cd71468cef42494ed6dabafa8b414482f2da9" head "https://github.com/aws/aws-cli.git", :branch => "develop" bottle do cellar :any_skip_relocation sha256 "06382e7ffd0e08141fbd740ab471cd32edc6f2b922bc713acb71d4b12f235a33" => :sierra sha256 "587458eee5348e7bb36a07b3ff05c99bd81a6810256c3398a243d62b2cdb5372" => :el_capitan sha256 "e638b62d35e23fb5921759337c1e7a3ecd395417a16d31b6475f4993d64f988f" => :yosemite end # Use :python on Lion to avoid urllib3 warning # https://github.com/Homebrew/homebrew/pull/37240 depends_on :python if MacOS.version <= :lion def install venv = virtualenv_create(libexec) system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:", "--ignore-installed", buildpath system libexec/"bin/pip", "uninstall", "-y", "awscli" venv.pip_install_and_link buildpath pkgshare.install "awscli/examples" bash_completion.install "bin/aws_bash_completer" zsh_completion.install "bin/aws_zsh_completer.sh" => "_aws" end def caveats; <<-EOS.undent The "examples" directory has been installed to: #{HOMEBREW_PREFIX}/share/awscli/examples EOS end test do assert_match "topics", shell_output("#{bin}/aws help") end end