homebrew-core/Formula/dvc.rb
2019-11-17 10:07:24 +01:00

47 lines
1.7 KiB
Ruby

class Dvc < Formula
include Language::Python::Virtualenv
desc "Git for data science projects"
homepage "https://dvc.org"
url "https://github.com/iterative/dvc/archive/0.68.1.tar.gz"
sha256 "a072ebf2151213c61ac7e580e51dc1cecefa4cd840e4f7ae1927d6710312cfe0"
revision 1
bottle do
sha256 "a561c535faeb646e91b206f2f1ce2fa3f36ac806f35848542873eef56e7f7ccd" => :catalina
sha256 "e3cd27498f8983c073fc05e3534e1237df95446e5f99850b64b8ae6ccf214d9a" => :mojave
sha256 "bd42b5e32e0867f77f1c82f67972f3bbfa3a145f10db6cf7e5cb8f86d0bd08fd" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "openssl@1.1"
depends_on "python"
def install
venv = virtualenv_create(libexec, "python3")
system libexec/"bin/pip", "install", ".[all]"
# NOTE: dvc depends on asciimatics, which depends on Pillow, which
# uses liblcms2.2.dylib that causes troubles on mojave. See [1]
# and [2] for more info. As a workaround, we need to simply
# uninstall Pillow.
#
# [1] https://github.com/peterbrittain/asciimatics/issues/95
# [2] https://github.com/iterative/homebrew-dvc/issues/9
system libexec/"bin/pip", "uninstall", "-y", "Pillow"
system libexec/"bin/pip", "uninstall", "-y", "dvc"
# NOTE: dvc uses this file [1] to know which package it was installed from,
# so that it is able to provide appropriate instructions for updates.
# [1] https://github.com/iterative/dvc/blob/0.68.1/dvc/utils/pkg.py
File.open("dvc/utils/build.py", "w+") { |file| file.write("PKG = \"brew\"") }
venv.pip_install_and_link buildpath
bash_completion.install "scripts/completion/dvc.bash" => "dvc"
zsh_completion.install "scripts/completion/dvc.zsh"
end
test do
system "#{bin}/dvc", "--version"
end
end