homebrew-core/Formula/b2-tools.rb

109 lines
5.1 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/e9/7e/9d3ae9857844f64df8ed1a1e358e17dc740fb9924eb2088cb2469d10f68a/b2-3.6.0.tar.gz"
sha256 "a879e751348b635ca772a2231be20c2e835abaf830534e2ab2f1fb75967c0252"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_monterey: "2871aa46b07404db6c4086796b3b9cb5a4e4e0f19701007a54605fff5770ca9c"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "9c58ed1a651560af4b2ba0110b44715b74e37cc6ce58d693c02e8b7be9374ab6"
sha256 cellar: :any_skip_relocation, monterey: "07b115a76281e8984fce00764498fab98302a39b3f044c3bb521ea82296c2782"
sha256 cellar: :any_skip_relocation, big_sur: "daf88f1312cd4bfe583a409f5a12e0b3b23f73e193b432190087014d8e50b921"
sha256 cellar: :any_skip_relocation, catalina: "7f6646669e048173e91ff4345d2b086b1e2d1953d64fe743b681199b04778f4c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ee9fcdc78899bb52c4e2d3b5ac376de4b0597a50fe9b100719eec0b1952ea2c4"
end
depends_on "docutils"
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/3f/6c/15582dbc9340586b6ee1d43070a43753cc9d1c3522db13cd38779f25a479/b2sdk-1.18.0.tar.gz"
sha256 "9272f28d18d498b66d33d749a0f05e49d9bb1a9134f94261c0b8bfa1b56f3eec"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/ca/48/88ec470f8b68319b6782ca3a0570789886ad5ca24c1af2f3771699135baa/certifi-2022.9.14.tar.gz"
sha256 "36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
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/ea/48/b1acdd934f89377fd047401f02c301b938f4962f5af30b8ad7224487c412/phx-class-registry-3.0.5.tar.gz"
sha256 "f11462ac410a8cda38c2b6a83b51a2390c7d9528baef591cb5b551b11aba2a92"
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/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
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/7a/53/afac341569b3fd558bf2b5428e925e2eb8753ad9627c1f9188104c6e0c4a/tabulate-0.8.10.tar.gz"
sha256 "6c57f3f3dd7ac2782770155f3adb2db0b1a269637e42f27599925e64b114f519"
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/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
end
def install
virtualenv_install_with_resources
# we depend on docutils, but that's a separate formula, so install a `.pth` file to link them
site_packages = Language::Python.site_packages("python3.10")
docutils = Formula["docutils"].opt_libexec
(libexec/site_packages/"homebrew-docutils.pth").write docutils/site_packages
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