From be947aa760341350e77035e68f0af5f2ec91bbc6 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Mon, 10 Oct 2022 11:59:05 +0200 Subject: [PATCH] huggingface-cli 0.10.1 (new formula) Closes #112767. Signed-off-by: Rui Chen Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/huggingface-cli.rb | 73 ++++++++++++++++++++++++++++++++++++++ pypi_formula_mappings.json | 4 +++ 2 files changed, 77 insertions(+) create mode 100644 Formula/huggingface-cli.rb diff --git a/Formula/huggingface-cli.rb b/Formula/huggingface-cli.rb new file mode 100644 index 00000000000..2e56a5513ac --- /dev/null +++ b/Formula/huggingface-cli.rb @@ -0,0 +1,73 @@ +class HuggingfaceCli < Formula + include Language::Python::Virtualenv + + desc "Client library for huggingface.co hub" + homepage "https://huggingface.co/docs/huggingface_hub/index" + url "https://files.pythonhosted.org/packages/34/f4/d8f9b6dc1534a436c498ffb3659a456e287349d24d80e95baf35344ccbcf/huggingface_hub-0.10.1.tar.gz" + sha256 "5c188d5b16bec4b78449f8681f9975ff9d321c16046cc29bcf0d7e464ff29276" + license "Apache-2.0" + + depends_on "git-lfs" + depends_on "python-typing-extensions" + depends_on "python@3.10" + depends_on "pyyaml" + + resource "certifi" do + url "https://files.pythonhosted.org/packages/cb/a4/7de7cd59e429bd0ee6521ba58a75adaec136d32f91a761b28a11d8088d44/certifi-2022.9.24.tar.gz" + sha256 "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14" + 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 "filelock" do + url "https://files.pythonhosted.org/packages/95/55/b897882bffb8213456363e646bf9e9fa704ffda5a7d140edf935a9e02c7b/filelock-3.8.0.tar.gz" + sha256 "55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc" + end + + resource "idna" do + url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz" + sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4" + end + + resource "packaging" do + url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz" + sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb" + end + + resource "pyparsing" do + url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz" + sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb" + end + + resource "requests" do + url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz" + sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983" + 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 + end + + test do + whoami_output = shell_output("#{bin}/huggingface-cli whoami") + assert_match "Not logged in", whoami_output + test_cache = testpath/"cache" + test_cache.mkdir + ENV["HUGGINGFACE_HUB_CACHE"] = test_cache.to_s + scan_output = shell_output("#{bin}/huggingface-cli scan-cache") + assert_match "Done in 0.0s. Scanned 0 repo(s) for a total of \e[1m\e[31m0.0\e[0m.", scan_output + end +end diff --git a/pypi_formula_mappings.json b/pypi_formula_mappings.json index 69cb0317e51..0853e4f760c 100644 --- a/pypi_formula_mappings.json +++ b/pypi_formula_mappings.json @@ -240,6 +240,10 @@ "http-prompt": { "exclude_packages": ["six", "PyYAML"] }, + "huggingface-cli": { + "package_name": "huggingface-hub", + "exclude_packages": ["PyYAML", "typing-extensions"] + }, "internetarchive": { "exclude_packages": ["six"] },