homebrew-core/Formula/awsume.rb

96 lines
4.1 KiB
Ruby

class Awsume < Formula
include Language::Python::Virtualenv
desc "Utility for easily assuming AWS IAM roles from the command-line"
homepage "https://www.trek10.com/blog/awsume-aws-assume-made-awesome"
url "https://github.com/trek10inc/awsume/archive/4.4.1.tar.gz"
sha256 "66d698b4716a1dc7c927778a8fe124a6ac2d99334aff2be5dac6b13598b4e08f"
license "MIT"
revision 1
head "https://github.com/trek10inc/awsume.git"
bottle do
cellar :any_skip_relocation
sha256 "09170cb98ec4947ddb04623d32745624623fc054f1c82edfa7f4c89442da9c7a" => :catalina
sha256 "503d4ddd068d70a0a5e2f7f4ea54584b551e8bb52f5c07f05801527bf5d750b3" => :mojave
sha256 "33c1bd0d60b93b7de79359a971d7abb9182cb33065036b8ece6d75a8bc437552" => :high_sierra
end
depends_on "openssl@1.1"
depends_on "python@3.8"
uses_from_macos "sqlite"
resource "boto3" do
url "https://files.pythonhosted.org/packages/6d/e3/bdd48e60b6ec83e77c4f5e300aff9999f0eac97f92b468cc69bd0871f096/boto3-1.13.25.tar.gz"
sha256 "1c37c727e0e6f872f5262a893a1ed5422ef0f1ed6075d35b809e20c3072dad5b"
end
resource "botocore" do
url "https://files.pythonhosted.org/packages/7c/b4/fd5f0e872c910db2685737c50797db273e6d8de706d9131aef4e8f0f04a5/botocore-1.16.25.tar.gz"
sha256 "b55b3acab42b58c24481a9fbb33d53fb7d8d03dfc0338af0132f6c5010006d0d"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/82/75/f2a4c0c94c85e2693c229142eb448840fba0f9230111faa889d1f541d12d/colorama-0.4.3.tar.gz"
sha256 "e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/93/22/953e071b589b0b1fee420ab06a0d15e5aa0c7470eb9966d60393ce58ad61/docutils-0.15.2.tar.gz"
sha256 "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"
end
resource "jmespath" do
url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz"
sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"
end
resource "pluggy" do
url "https://files.pythonhosted.org/packages/f8/04/7a8542bed4b16a65c2714bf76cf5a0b026157da7f75e87cc88774aa10b14/pluggy-0.13.1.tar.gz"
sha256 "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"
end
resource "psutil" do
url "https://files.pythonhosted.org/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz"
sha256 "685ec16ca14d079455892f25bd124df26ff9137664af445563c1bd36629b5e0e"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz"
sha256 "b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"
end
resource "s3transfer" do
url "https://files.pythonhosted.org/packages/50/de/2b688c062107942486c81a739383b1432a72717d9a85a6a1a692f003c70c/s3transfer-0.3.3.tar.gz"
sha256 "921a37e2aefc64145e7b73d50c71bb4f26f46e4c9f414dc648c6245ff92cf7db"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/05/8c/40cd6949373e23081b3ea20d5594ae523e681b6f472e600fbc95ed046a36/urllib3-1.25.9.tar.gz"
sha256 "3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"
end
def install
virtualenv_install_with_resources
end
test do
assert_includes "4.0.0", shell_output("#{bin}/awsume -v")
file_path = File.expand_path("~/.awsume/config.yaml")
shell_output(File.exist?(file_path))
assert_match "PROFILE TYPE SOURCE MFA? REGION ACCOUNT", shell_output("#{bin}/awsume --list-profiles 2>&1")
end
end