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.138.tar.gz" sha256 "ecc411a0db77694ef7a24853bef770ca1c9e54d747a1283599ea7a3a3c1478d0" head "https://github.com/aws/aws-cli.git", :branch => "develop" bottle do cellar :any_skip_relocation sha256 "5633905ee9eb041c51475452a851fcc3aa3594603e921e518973a9a3a6c1cf0a" => :sierra sha256 "8080847353f6434e7e744bfff651162c36ac90f2a6f4e606bc77e9c9f8a9a83b" => :el_capitan sha256 "a822366a32b320cc2009e3c24154ee9f51ace4af3b222c1df97df93533ab437f" => :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