241 lines
11 KiB
Ruby
241 lines
11 KiB
Ruby
class CloudformationCli < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "CloudFormation Provider Development Toolkit"
|
|
homepage "https://github.com/aws-cloudformation/cloudformation-cli/"
|
|
url "https://files.pythonhosted.org/packages/00/f2/d95f135f63b32214d1f99abc7b7bb26349a941a436654b7e6fc84a724b9e/cloudformation-cli-0.1.5.tar.gz"
|
|
sha256 "04616a8bfb665cc6d0067ad30387fef93cf029d46626d86cf64e799ca909eebd"
|
|
license "Apache-2.0"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "df0e950f730dca17e599fa5d35a10991739706660e896afd1300612004ff5b1f" => :catalina
|
|
sha256 "c756e72cfe918a9bbd33ed2d75e3641a7005133d05f206ec35d1bf43ee763bbe" => :mojave
|
|
sha256 "b5c09cba779186197aa35a3f8a86a0665b05b94e386049097fb345a3e3e05cc9" => :high_sierra
|
|
end
|
|
|
|
depends_on "go" => :test
|
|
depends_on "python@3.8"
|
|
|
|
uses_from_macos "expect" => :test
|
|
|
|
# Generated with homebrew-pypi-poet from:
|
|
# poet -r cloudformation-cli -a cloudformation-cli-java-plugin -a cloudformation-cli-go-plugin \
|
|
# -a attrs -a boto3 -a botocore -a certifi -a chardet \
|
|
# -a colorama -a docutils -a hypothesis -a idna -a Jinja2 \
|
|
# -a jmespath -a jsonschema -a MarkupSafe -a more-itertools -a packaging \
|
|
# -a pluggy -a py -a pyparsing -a pyrsistent -a pytest \
|
|
# -a python-dateutil -a PyYAML -a requests -a s3transfer -a semver \
|
|
# -a six -a sortedcontainers -a urllib3 -a wcwidth -a Werkzeug > resources
|
|
|
|
resource "attrs" do
|
|
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
|
|
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
|
|
end
|
|
|
|
resource "boto3" do
|
|
url "https://files.pythonhosted.org/packages/85/c6/00e25614edf5ac025684bcc7af4c750187249ea7abbfc19dac05b95e83e8/boto3-1.14.22.tar.gz"
|
|
sha256 "07bd0872e9178b637baefb82aff8abb76197770c9fc60c4d6575564ba878e3e4"
|
|
end
|
|
|
|
resource "botocore" do
|
|
url "https://files.pythonhosted.org/packages/c0/51/eec13a6ee1fd802bf61070013c7ec354dec262ada8f62eef886ebcc17ba1/botocore-1.17.22.tar.gz"
|
|
sha256 "4d084dfcfcdf21ac2df17d017607ca53d53ac6c2fa17484cdd87ef78daba06b8"
|
|
end
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/40/a7/ded59fa294b85ca206082306bba75469a38ea1c7d44ea7e1d64f5443d67a/certifi-2020.6.20.tar.gz"
|
|
sha256 "5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"
|
|
end
|
|
|
|
resource "chardet" do
|
|
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
|
|
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
|
|
end
|
|
|
|
resource "cloudformation-cli-go-plugin" do
|
|
url "https://files.pythonhosted.org/packages/de/ff/ac1b30082d588070f148babdcca0d995e1101e6a85ce3afbd9ce3dbbf894/cloudformation-cli-go-plugin-2.0.0.tar.gz"
|
|
sha256 "2f50a28fb6125c10071aac21f10d6be75df841d8471d88e1a07acdf314407a26"
|
|
end
|
|
|
|
resource "cloudformation-cli-java-plugin" do
|
|
url "https://files.pythonhosted.org/packages/53/74/849b45a6b5871cea65e8157ac7872558fb84a0f5ba12ab496ff3c2b7c9f7/cloudformation-cli-java-plugin-2.0.1.tar.gz"
|
|
sha256 "85659fb8aabf9edf18f0c71b6a6c8a537cac564bdb25052e9c68191a094a76f6"
|
|
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 "hypothesis" do
|
|
url "https://files.pythonhosted.org/packages/fd/51/fe3868c4fc61b5a82a2074b0ebd26086ed9cd9ea5699ec385640256daf52/hypothesis-5.19.3.tar.gz"
|
|
sha256 "b58b40984915fbea34db942f58faac78f3db66e379b5394cad0d0ef60b7d98be"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
|
|
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
|
|
end
|
|
|
|
resource "Jinja2" do
|
|
url "https://files.pythonhosted.org/packages/64/a7/45e11eebf2f15bf987c3bc11d37dcc838d9dc81250e67e4c5968f6008b6c/Jinja2-2.11.2.tar.gz"
|
|
sha256 "89aab215427ef59c34ad58735269eb58b1a5808103067f7bb9d5836c651b3bb0"
|
|
end
|
|
|
|
resource "jmespath" do
|
|
url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz"
|
|
sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"
|
|
end
|
|
|
|
resource "jsonschema" do
|
|
url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz"
|
|
sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"
|
|
end
|
|
|
|
resource "MarkupSafe" do
|
|
url "https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz"
|
|
sha256 "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"
|
|
end
|
|
|
|
resource "more-itertools" do
|
|
url "https://files.pythonhosted.org/packages/67/4a/16cb3acf64709eb0164e49ba463a42dc45366995848c4f0cf770f57b8120/more-itertools-8.4.0.tar.gz"
|
|
sha256 "68c70cc7167bdf5c7c9d8f6954a7837089c6a36bf565383919bb595efb8a17e5"
|
|
end
|
|
|
|
resource "packaging" do
|
|
url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz"
|
|
sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"
|
|
end
|
|
|
|
resource "pluggy" do
|
|
url "https://files.pythonhosted.org/packages/f8/04/7a8542bed4b16a65c2714bf76cf5a0b026157da7f75e87cc88774aa10b14/pluggy-0.13.1.tar.gz"
|
|
sha256 "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"
|
|
end
|
|
|
|
resource "py" do
|
|
url "https://files.pythonhosted.org/packages/97/a6/ab9183fe08f69a53d06ac0ee8432bc0ffbb3989c575cc69b73a0229a9a99/py-1.9.0.tar.gz"
|
|
sha256 "9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"
|
|
end
|
|
|
|
resource "pyparsing" do
|
|
url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz"
|
|
sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"
|
|
end
|
|
|
|
resource "pyrsistent" do
|
|
url "https://files.pythonhosted.org/packages/9f/0d/cbca4d0bbc5671822a59f270e4ce3f2195f8a899c97d0d5abb81b191efb5/pyrsistent-0.16.0.tar.gz"
|
|
sha256 "28669905fe725965daa16184933676547c5bb40a5153055a8dee2a4bd7933ad3"
|
|
end
|
|
|
|
resource "pytest" do
|
|
url "https://files.pythonhosted.org/packages/8f/c4/e4a645f8a3d6c6993cb3934ee593e705947dfafad4ca5148b9a0fde7359c/pytest-5.4.3.tar.gz"
|
|
sha256 "7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"
|
|
end
|
|
|
|
resource "pytest-localserver" do
|
|
url "https://files.pythonhosted.org/packages/6c/b3/db8f8700718fbefaa2e8b2ef690fec147e560ce92e2300cdb3ff462d313c/pytest-localserver-0.5.0.tar.gz"
|
|
sha256 "3a5427909d1dfda10772c1bae4b9803679c0a8f04adb66c338ac607773bfefc2"
|
|
end
|
|
|
|
resource "pytest-random-order" do
|
|
url "https://files.pythonhosted.org/packages/f4/70/e9f80dcbddfc131704d381fd3dc7822a1652765a1b88326a8d84bdc44738/pytest-random-order-1.0.4.tar.gz"
|
|
sha256 "6b2159342a4c8c10855bc4fc6d65ee890fc614cb2b4ff688979b008a82a0ff52"
|
|
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 "requests" do
|
|
url "https://files.pythonhosted.org/packages/da/67/672b422d9daf07365259958912ba533a0ecab839d4084c487a5fe9a5405f/requests-2.24.0.tar.gz"
|
|
sha256 "b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"
|
|
end
|
|
|
|
resource "s3transfer" do
|
|
url "https://files.pythonhosted.org/packages/50/de/2b688c062107942486c81a739383b1432a72717d9a85a6a1a692f003c70c/s3transfer-0.3.3.tar.gz"
|
|
sha256 "921a37e2aefc64145e7b73d50c71bb4f26f46e4c9f414dc648c6245ff92cf7db"
|
|
end
|
|
|
|
resource "semver" do
|
|
url "https://files.pythonhosted.org/packages/aa/e8/cb894f70a52887f001aff5f264f68272c21fa58268495aca17df396c161f/semver-2.10.2.tar.gz"
|
|
sha256 "c0a4a9d1e45557297a722ee9bac3de2ec2ea79016b6ffcaca609b0bc62cf4276"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
|
|
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
|
|
end
|
|
|
|
resource "sortedcontainers" do
|
|
url "https://files.pythonhosted.org/packages/3b/fb/48f6fa11e4953c530b09fa0f2976df5234b0eaabcd158625c3e73535aeb8/sortedcontainers-2.2.2.tar.gz"
|
|
sha256 "4e73a757831fc3ca4de2859c422564239a31d8213d09a2a666e375807034d2ba"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/05/8c/40cd6949373e23081b3ea20d5594ae523e681b6f472e600fbc95ed046a36/urllib3-1.25.9.tar.gz"
|
|
sha256 "3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"
|
|
end
|
|
|
|
resource "wcwidth" do
|
|
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
|
|
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
|
|
end
|
|
|
|
resource "Werkzeug" do
|
|
url "https://files.pythonhosted.org/packages/10/27/a33329150147594eff0ea4c33c2036c0eadd933141055be0ff911f7f8d04/Werkzeug-1.0.1.tar.gz"
|
|
sha256 "6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
bin.install_symlink libexec/"bin/cfn"
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
cloudformation java and go plugins are installed, but the Go and Java are not bundled with the installation.
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
script = (testpath/"test.sh")
|
|
script.write <<~EOS
|
|
#!/usr/bin/env expect -f
|
|
set timeout -1
|
|
|
|
spawn #{bin}/cfn init
|
|
|
|
expect -exact "What's the name of your resource type?"
|
|
send -- "brew::formula::test\r"
|
|
|
|
expect -exact "Select a language for code generation:"
|
|
send -- "1\r"
|
|
|
|
expect -exact "Enter the GO Import path"
|
|
send -- "\r"
|
|
|
|
expect -exact "Initialized a new project in"
|
|
expect eof
|
|
EOS
|
|
|
|
script.chmod 0700
|
|
system "./test.sh"
|
|
|
|
rpdk_config = JSON.parse(File.read(testpath/".rpdk-config"))
|
|
assert_equal "brew::formula::test", rpdk_config["typeName"]
|
|
assert_equal "go", rpdk_config["language"]
|
|
end
|
|
end
|