72 lines
3.0 KiB
Ruby
72 lines
3.0 KiB
Ruby
class Pipx < Formula
|
|
desc "Execute binaries from Python packages in isolated environments"
|
|
homepage "https://github.com/pipxproject/pipx"
|
|
url "https://files.pythonhosted.org/packages/29/06/20d904aa0fac35f5f06c098aa9d3fcaa031dc33ae25a711d3fbc23ca23be/pipx-0.16.0.0.tar.gz"
|
|
sha256 "ec9d63753f34eb2dde5597ecdfe23df61749104485eead42937abec4dc4f4598"
|
|
license "MIT"
|
|
head "https://github.com/pipxproject/pipx.git"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "07c91b1e0ba3aaf7e285b21b2535c8c6a8d5adbf9558d119ec0c8538ea7477b1" => :big_sur
|
|
sha256 "7175a21e5bf6045390b320c5eb5e88351bd7b3ac56fd7406390d45ac69876c59" => :arm64_big_sur
|
|
sha256 "80b40dd15aba425da48c79134bd2d4cd52cefbb19fe7caec4d8c61b2d9fffe50" => :catalina
|
|
sha256 "beaba00c300b58c6208375b34e95890515c77842508fb3b8e92ac16076e4001f" => :mojave
|
|
end
|
|
|
|
depends_on "python@3.9"
|
|
|
|
resource "argcomplete" do
|
|
url "https://files.pythonhosted.org/packages/cb/53/d2e3d11726367351b00c8f078a96dacb7f57aef2aca0d3b6c437afc56b55/argcomplete-1.12.2.tar.gz"
|
|
sha256 "de0e1282330940d52ea92a80fea2e4b9e0da1932aaa570f84d268939d1897b04"
|
|
end
|
|
|
|
resource "click" do
|
|
url "https://files.pythonhosted.org/packages/27/6f/be940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e/click-7.1.2.tar.gz"
|
|
sha256 "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"
|
|
end
|
|
|
|
resource "packaging" do
|
|
url "https://files.pythonhosted.org/packages/d7/c5/e81b9fb8033fe78a2355ea7b1774338e1dca2c9cbd2ee140211a9e6291ab/packaging-20.8.tar.gz"
|
|
sha256 "78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093"
|
|
end
|
|
|
|
resource "pyparsing" do
|
|
url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz"
|
|
sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"
|
|
end
|
|
|
|
resource "userpath" do
|
|
url "https://files.pythonhosted.org/packages/86/2b/0a443e7978ea0f6bc1baece1de35545fa12f6d9fc5451aa90529db41db70/userpath-1.4.1.tar.gz"
|
|
sha256 "211544ea02d8715fdc06f429cf66cd18c9877a31751d966d6de11b24faaed255"
|
|
end
|
|
|
|
def install
|
|
xy = Language::Python.major_minor_version "python3"
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
|
|
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "python3", *Language::Python.setup_install_args(libexec)
|
|
end
|
|
end
|
|
|
|
system "python3", *Language::Python.setup_install_args(libexec)
|
|
(bin/"pipx").write_env_script(libexec/"bin/pipx", PYTHONPATH: ENV["PYTHONPATH"])
|
|
(bin/"register-python-argcomplete").write_env_script(libexec/"bin/register-python-argcomplete",
|
|
PYTHONPATH: ENV["PYTHONPATH"])
|
|
end
|
|
|
|
test do
|
|
assert_match "PIPX_HOME", shell_output("#{bin}/pipx --help")
|
|
system "#{bin}/pipx", "install", "csvkit"
|
|
assert_true FileTest.exist?("#{testpath}/.local/bin/csvjoin")
|
|
system "#{bin}/pipx", "uninstall", "csvkit"
|
|
assert_no_match Regexp.new("csvjoin"), shell_output("#{bin}/pipx list")
|
|
end
|
|
end
|