2019-10-22 23:28:49 +00:00
|
|
|
class Dvc < Formula
|
|
|
|
include Language::Python::Virtualenv
|
|
|
|
|
|
|
|
desc "Git for data science projects"
|
|
|
|
homepage "https://dvc.org"
|
2019-12-08 03:37:00 +00:00
|
|
|
url "https://github.com/iterative/dvc/archive/0.75.0.tar.gz"
|
|
|
|
sha256 "5a7c17ee02195400f716478c0d4d10ae083169abee753088a52a1b483b714035"
|
2019-10-22 23:28:49 +00:00
|
|
|
|
2019-10-24 05:45:02 +00:00
|
|
|
bottle do
|
2019-11-18 04:33:52 +00:00
|
|
|
cellar :any
|
2019-12-08 04:01:41 +00:00
|
|
|
sha256 "b9f8bd93ebebee11b893bb8d499354ba25d9381ce98488fb342c2c2c81b9fc71" => :catalina
|
|
|
|
sha256 "f55f950c887fc1ac738e049a3ff809d04748d8240cff52e08be1a341d11954f1" => :mojave
|
|
|
|
sha256 "d4222de6499e688d737cca30109d233220623a8bfa6cd2bf3743421c55764a6f" => :high_sierra
|
2019-10-24 05:45:02 +00:00
|
|
|
end
|
|
|
|
|
2019-10-22 23:28:49 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2019-11-18 03:02:57 +00:00
|
|
|
depends_on "apache-arrow"
|
2019-11-17 01:13:17 +00:00
|
|
|
depends_on "openssl@1.1"
|
2019-10-22 23:28:49 +00:00
|
|
|
depends_on "python"
|
|
|
|
|
|
|
|
def install
|
|
|
|
venv = virtualenv_create(libexec, "python3")
|
2019-11-18 03:02:57 +00:00
|
|
|
|
|
|
|
system libexec/"bin/pip", "install",
|
|
|
|
"--no-binary", ":all:",
|
|
|
|
# NOTE: we will uninstall Pillow anyway, so there is no need to build it
|
|
|
|
# from source.
|
|
|
|
"--only-binary", "Pillow",
|
|
|
|
"--ignore-installed",
|
|
|
|
# NOTE: pyarrow is already installed as a part of apache-arrow package,
|
|
|
|
# so we don't need to specify `hdfs` option.
|
|
|
|
".[gs,s3,azure,oss,ssh]"
|
|
|
|
|
2019-10-22 23:28:49 +00:00
|
|
|
# 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"
|
2019-11-11 15:50:56 +00:00
|
|
|
|
|
|
|
# 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\"") }
|
|
|
|
|
2019-10-22 23:28:49 +00:00
|
|
|
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
|