homebrew-core/Formula/molecule.rb

141 lines
6.4 KiB
Ruby

class Molecule < Formula
include Language::Python::Virtualenv
desc "Automated testing for Ansible roles"
homepage "https://molecule.readthedocs.io"
url "https://files.pythonhosted.org/packages/2c/78/83ded572b1ad3c0be6855ee7f54343d783ad076ca617e9a85fcc7e32f31a/molecule-4.0.2.tar.gz"
sha256 "13362f741a1c80279a2b25f49a1f55c3bfc345054c5feedcdcdf928e1103e1e5"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_monterey: "d3021b5e95e1d20e75a753f74615acef80382ac34960a26d23ac4a26198db31d"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "f3f88382c1290dee14c36078ff970ac763f13987e522f7ee575e5fc54e9c3913"
sha256 cellar: :any_skip_relocation, monterey: "de85ea458836b78ad3b114c0de32b60ce70756c402052f249aef42b99e4bd40e"
sha256 cellar: :any_skip_relocation, big_sur: "30f2a6766ceb14923ca01647623a6a142a6fe7d88cc4bfc5086c7daa39ca4227"
sha256 cellar: :any_skip_relocation, catalina: "153c4080f009e46fea7737c17790ffbcded17fe02eaaa6824fd7f141ff361512"
sha256 cellar: :any_skip_relocation, x86_64_linux: "8166c9b1e3f0ec47b693b06ce98337a08d3f774067b4f5ac67f2303965ea0b20"
end
depends_on "rust" => :build
depends_on "ansible"
depends_on "cookiecutter"
depends_on "jsonschema"
depends_on "openssl@1.1"
depends_on "pygments"
depends_on "python@3.10"
depends_on "pyyaml"
depends_on "six"
uses_from_macos "libffi"
on_linux do
depends_on "pkg-config" => :build
depends_on "gmp"
end
resource "ansible-compat" do
url "https://files.pythonhosted.org/packages/e7/20/3cbc78afd3bee6a30b95506819b57e70e4e12c3c69da4de35ce2dd03a216/ansible-compat-2.2.1.tar.gz"
sha256 "7a012753a0a02dab2f22b0e574e3e7b00399f660606154474ffe25621fa80d3b"
end
resource "click-help-colors" do
url "https://files.pythonhosted.org/packages/6c/c1/abc07420cfdc046c1005e16bc8090bc1f226d631b2bd172e5a8f5524c127/click-help-colors-0.9.1.tar.gz"
sha256 "78cbcf30cfa81c5fc2a52f49220121e1a8190cd19197d9245997605d3405824d"
end
resource "commonmark" do
url "https://files.pythonhosted.org/packages/60/48/a60f593447e8f0894ebb7f6e6c1f25dafc5e89c5879fdc9360ae93ff83f0/commonmark-0.9.1.tar.gz"
sha256 "452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"
end
resource "distro" do
url "https://files.pythonhosted.org/packages/4b/89/eaa3a3587ebf8bed93e45aa79be8c2af77d50790d15b53f6dfc85b57f398/distro-1.8.0.tar.gz"
sha256 "02e111d1dc6a50abb8eed6bf31c3e48ed8b0830d1ea2a1b78c61765c2513fdd8"
end
resource "docker-py" do
url "https://files.pythonhosted.org/packages/fa/2d/906afc44a833901fc6fed1a89c228e5c88fbfc6bd2f3d2f0497fdfb9c525/docker-py-1.10.6.tar.gz"
sha256 "4c2a75875764d38d67f87bc7d03f7443a3895704efc57962bdf6500b8d4bc415"
end
resource "docker-pycreds" do
url "https://files.pythonhosted.org/packages/c5/e6/d1f6c00b7221e2d7c4b470132c931325c8b22c51ca62417e300f5ce16009/docker-pycreds-0.4.0.tar.gz"
sha256 "6ce3270bcaf404cc4c3e27e4b6c70d3521deae82fb508767870fdbf772d584d4"
end
resource "enrich" do
url "https://files.pythonhosted.org/packages/bb/77/cb9b3d6f2e2e5f8104e907ea4c4d575267238f52c51cf9f864b865a99710/enrich-1.2.7.tar.gz"
sha256 "0a2ab0d2931dff8947012602d1234d2a3ee002d9a355b5d70be6bf5466008893"
end
resource "molecule-vagrant" do
url "https://files.pythonhosted.org/packages/ae/6c/419f7aebe62d9cf523245c59a02dd79290f38408ac5a80e80fcd389863f8/molecule-vagrant-1.0.0.tar.gz"
sha256 "fc1e988147226ada8288475b768c52a37366c8b50d30b91635cacfc64e1468c3"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz"
sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"
end
resource "pluggy" do
url "https://files.pythonhosted.org/packages/a1/16/db2d7de3474b6e37cbb9c008965ee63835bba517e22cdb8c35b5116b5ce1/pluggy-1.0.0.tar.gz"
sha256 "4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
end
resource "python-vagrant" do
url "https://files.pythonhosted.org/packages/2b/3f/2e42a44c9705d72d9925fe8daf00f31bcf82e8b84ec5a752a8a1357c3ef8/python-vagrant-1.0.0.tar.gz"
sha256 "a8fe93ccf2ff37ecc95ec2f49ea74a91a6ce73a4db4a16a98dd26d397cfd09e5"
end
resource "rich" do
url "https://files.pythonhosted.org/packages/11/23/814edf09ec6470d52022b9e95c23c1bef77f0bc451761e1504ebd09606d3/rich-12.6.0.tar.gz"
sha256 "ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0"
end
resource "selinux" do
url "https://files.pythonhosted.org/packages/1a/f1/5755b134895bb9b29d6937cae52d0f58140bb97df0f72c33231345294e80/selinux-0.2.1.tar.gz"
sha256 "d435f514e834e3fdc0941f6a29d086b80b2ea51b28112aee6254bd104ee42a74"
end
resource "subprocess-tee" do
url "https://files.pythonhosted.org/packages/48/20/a38a078b58532bd44c4c189c85cc650268d1894a1dcc7080b6e7e9cfe7bb/subprocess-tee-0.3.5.tar.gz"
sha256 "ff5cced589a4b8ac973276ca1ba21bb6e3de600cde11a69947ff51f696efd577"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/99/11/01fe7ebcb7545a1990c53c11f31230afe1388b0b34256e3fd20e49482245/websocket-client-1.4.1.tar.gz"
sha256 "f9611eb65c8241a67fb373bef040b3cf8ad377a9f6546a12b620b6511e8ea9ef"
end
def install
virtualenv_install_with_resources
site_packages = Language::Python.site_packages("python3.10")
%w[cookiecutter jsonschema].each do |package_name|
package = Formula[package_name].opt_libexec
(libexec/site_packages/"homebrew-#{package_name}.pth").write package/site_packages
end
end
test do
ENV["ANSIBLE_REMOTE_TMP"] = testpath/"tmp"
# Test the Vagrant driver
system bin/"molecule", "init", "role", "acme.foo_vagrant", "--driver-name",
"vagrant", "--verifier-name", "testinfra"
assert_predicate testpath/"foo_vagrant/molecule/default/molecule.yml", :exist?,
"Failed to create 'foo_vagrant/molecule/default/molecule.yml' file!"
assert_predicate testpath/"foo_vagrant/molecule/default/tests/test_default.py", :exist?,
"Failed to create 'foo_vagrant/molecule/default/tests/test_default.py' file!"
cd "foo_vagrant" do
system bin/"molecule", "list"
end
end
end