diff --git a/Formula/h/httptap.rb b/Formula/h/httptap.rb new file mode 100644 index 0000000000000..bde670e84698c --- /dev/null +++ b/Formula/h/httptap.rb @@ -0,0 +1,105 @@ +class Httptap < Formula + include Language::Python::Virtualenv + + desc "HTTP request visualizer with phase-by-phase timing breakdown" + homepage "https://httptap.dev" + url "https://files.pythonhosted.org/packages/7a/6a/f0da6ea52f95d4a4550e681223100e4a9171394dbaaecaa2c1588be55280/httptap-0.1.1.tar.gz" + sha256 "c365dbd7de5ad50caadd2eb827ea3e205a2985f437f3c472fd9fbb324fa01a38" + license "Apache-2.0" + + bottle do + sha256 cellar: :any_skip_relocation, all: "bf1e2b486b91ff435070008b41acb5c688d7e1585ccfb9fb295f95624afb0c14" + end + + depends_on "rust" => :build + depends_on "python@3.14" + + resource "anyio" do + url "https://files.pythonhosted.org/packages/c6/78/7d432127c41b50bccba979505f272c16cbcadcc33645d5fa3a738110ae75/anyio-4.11.0.tar.gz" + sha256 "82a8d0b81e318cc5ce71a5f1f8b5c4e63619620b63141ef8c995fa0db95a57c4" + end + + resource "certifi" do + url "https://files.pythonhosted.org/packages/4c/5b/b6ce21586237c77ce67d01dc5507039d444b630dd76611bbca2d8e5dcd91/certifi-2025.10.5.tar.gz" + sha256 "47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43" + end + + resource "dnspython" do + url "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz" + sha256 "181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f" + end + + resource "h11" do + url "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz" + sha256 "4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1" + end + + resource "h2" do + url "https://files.pythonhosted.org/packages/1d/17/afa56379f94ad0fe8defd37d6eb3f89a25404ffc71d4d848893d270325fc/h2-4.3.0.tar.gz" + sha256 "6c59efe4323fa18b47a632221a1888bd7fde6249819beda254aeca909f221bf1" + end + + resource "hpack" do + url "https://files.pythonhosted.org/packages/2c/48/71de9ed269fdae9c8057e5a4c0aa7402e8bb16f2c6e90b3aa53327b113f8/hpack-4.1.0.tar.gz" + sha256 "ec5eca154f7056aa06f196a557655c5b009b382873ac8d1e66e79e87535f1dca" + end + + resource "httpcore" do + url "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz" + sha256 "6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8" + end + + resource "httpx" do + url "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz" + sha256 "75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc" + end + + resource "hyperframe" do + url "https://files.pythonhosted.org/packages/02/e7/94f8232d4a74cc99514c13a9f995811485a6903d48e5d952771ef6322e30/hyperframe-6.1.0.tar.gz" + sha256 "f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08" + end + + resource "idna" do + url "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz" + sha256 "795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902" + end + + resource "markdown-it-py" do + url "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz" + sha256 "cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3" + end + + resource "mdurl" do + url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz" + sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" + end + + resource "pygments" do + url "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz" + sha256 "636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887" + end + + resource "rich" do + url "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz" + sha256 "73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4" + end + + resource "sniffio" do + url "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz" + sha256 "f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc" + end + + def install + # The source doesn't have a valid SOURCE_DATE_EPOCH, so here we set default. + ENV["SOURCE_DATE_EPOCH"] = "1451574000" + + virtualenv_install_with_resources + end + + test do + ENV["NO_COLOR"] = "1" + + system bin/"httptap", "--metrics-only", "--json", testpath/"report.json", "https://example.com" + assert_path_exists testpath/"report.json", "JSON report was not created" + end +end