homebrew-core/Formula/b2-tools.rb

109 lines
5.3 KiB
Ruby

class B2Tools < Formula
include Language::Python::Virtualenv
desc "B2 Cloud Storage Command-Line Tools"
homepage "https://github.com/Backblaze/B2_Command_Line_Tool"
url "https://files.pythonhosted.org/packages/06/9b/2f5e207a898458172e53ecddb5be8e6728a877441d7a300cd0f381424c43/b2-3.7.0.tar.gz"
sha256 "b16ea0699594877597fb4faa1d1950e20673294e1b2fc78f3cd296a3dadd17ce"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "217e9d20ea75792705b7b05ae7a31205ef0beacd0f5d9013faf117b97eb70cc9"
sha256 cellar: :any_skip_relocation, arm64_monterey: "70a9e69a1931024ccd8d3397d1e9da88239f330609eeedf67fabf84da70bec01"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "f45b7434d1f2f0c17b36ef6c90467dbfb1cbec54125a4b18279a6540f7fe801a"
sha256 cellar: :any_skip_relocation, ventura: "a3d788dc987a6804b47d4b32f154adfadcb63285ca4fbabecbd035d5e7146626"
sha256 cellar: :any_skip_relocation, monterey: "3f273deccf6ca2993046b509984bc9639c25a3633bbbd6872b71a2d2214679c9"
sha256 cellar: :any_skip_relocation, big_sur: "e282f6c71020ac59d981e157c7f6686b94e7620c7255fc1c1e65be5d332d3077"
sha256 cellar: :any_skip_relocation, x86_64_linux: "7ffc1ac9c8b54fecfe667786289beb71cb3a30eece7fb2aafe1ca148b7c318bc"
end
# Does not work with Python 3.11, see https://github.com/Backblaze/B2_Command_Line_Tool/issues/834
depends_on "python@3.10"
depends_on "six"
conflicts_with "boost-build", because: "both install `b2` binaries"
resource "arrow" do
url "https://files.pythonhosted.org/packages/7f/c0/c601ea7811f422700ef809f167683899cdfddec5aa3f83597edf97349962/arrow-1.2.3.tar.gz"
sha256 "3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1"
end
resource "b2sdk" do
url "https://files.pythonhosted.org/packages/26/d2/c9f0ab04ad9a91c537783a8d6e9fcae041eb02dfdffe5f361a7120696388/b2sdk-1.19.0.tar.gz"
sha256 "689a52b7e7578f0e12df774188c91a47ac31cf02ebbbe8ec7ae3ca163d91dfa6"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/37/f7/2b1b0ec44fdc30a3d31dfebe52226be9ddc40cd6c0f34ffc8923ba423b69/certifi-2022.12.7.tar.gz"
sha256 "35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/96/d7/1675d9089a1f4677df5eb29c3f8b064aa1e70c1251a0a8a127803158942d/charset-normalizer-3.0.1.tar.gz"
sha256 "ebea339af930f8ca5d7a699b921106c6e29c617fe9606fa7baa043c1cdae326f"
end
resource "docutils" do
url "https://files.pythonhosted.org/packages/6b/5c/330ea8d383eb2ce973df34d1239b3b21e91cd8c865d21ff82902d952f91f/docutils-0.19.tar.gz"
sha256 "33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz"
sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"
end
resource "logfury" do
url "https://files.pythonhosted.org/packages/90/f2/24389d99f861dd65753fc5a56e2672339ec1b078da5e2f4b174d0767b132/logfury-1.0.1.tar.gz"
sha256 "130a5daceab9ad534924252ddf70482aa2c96662b3a3825a7d30981d03b76a26"
end
resource "phx-class-registry" do
url "https://files.pythonhosted.org/packages/13/1a/68634f03fe8526038afe90fbb7da79e3ac3bf5dfadc73d92a6f01830b01b/phx-class-registry-4.0.5.tar.gz"
sha256 "1901bdaea34d9cfefa4d149b2f20217e7e024492f7e247797e7c4d36d96cdb5b"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/9d/ee/391076f5937f0a8cdf5e53b701ffc91753e87b07d66bae4a09aa671897bf/requests-2.28.2.tar.gz"
sha256 "98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"
end
resource "rst2ansi" do
url "https://files.pythonhosted.org/packages/3c/19/b29bc04524e7d1dbde13272fbb67e45a8eb24bb6d112cf10c46162b350d7/rst2ansi-0.1.5.tar.gz"
sha256 "1b17fb9a628d40f57933ad1a3aa952346444be069469508e73e95060da33fe6f"
end
resource "tabulate" do
url "https://files.pythonhosted.org/packages/ec/fe/802052aecb21e3797b8f7902564ab6ea0d60ff8ca23952079064155d1ae1/tabulate-0.9.0.tar.gz"
sha256 "0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c"
end
resource "tqdm" do
url "https://files.pythonhosted.org/packages/c1/c2/d8a40e5363fb01806870e444fc1d066282743292ff32a9da54af51ce36a2/tqdm-4.64.1.tar.gz"
sha256 "5f4f682a004951c1b450bc753c710e9280c5746ce6ffedee253ddbcbf54cf1e4"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/c5/52/fe421fb7364aa738b3506a2d99e4f3a56e079c0a798e9f4fa5e14c60922f/urllib3-1.26.14.tar.gz"
sha256 "076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72"
end
def install
virtualenv_install_with_resources
bash_completion.install "contrib/bash_completion/b2" => "b2-tools-completion.bash"
pkgshare.install (buildpath/"contrib").children
end
test do
ENV["LC_ALL"] = "en_US.UTF-8"
cmd = "#{bin}/b2 authorize_account BOGUSACCTID BOGUSAPPKEY 2>&1"
assert_match "unable to authorize account", shell_output(cmd, 1)
end
end