From 8dfb05f8128921ec8fa2afbb4d22f032b247c298 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 24 Jul 2021 17:15:41 -0700 Subject: [PATCH] python-launcher 1.0.0 (new formula) Add the Python Launcher formula Closes #81855. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/python-launcher.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Formula/python-launcher.rb diff --git a/Formula/python-launcher.rb b/Formula/python-launcher.rb new file mode 100644 index 0000000000000..4ca82b5c23f86 --- /dev/null +++ b/Formula/python-launcher.rb @@ -0,0 +1,25 @@ +class PythonLauncher < Formula + desc "Launch your Python interpreter the lazy/smart way" + homepage "https://github.com/brettcannon/python-launcher" + url "https://github.com/brettcannon/python-launcher/archive/refs/tags/v1.0.0.tar.gz" + sha256 "31e5a4e50e3db4506e8484db06f6503df1225f482b40a892ffb5131b4ec11a43" + license "MIT" + head "https://github.com/brettcannon/python-launcher.git", branch: "main" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + + man1.install "docs/man-page/py.1" + fish_completion.install "completions/py.fish" + end + + test do + binary = testpath/"python3.6" + binary.write("Fake Python 3.6 executable") + with_env("PATH" => testpath) do + assert_match("3.6 │ #{binary}", shell_output("#{bin}/py --list")) + end + end +end