293 lines
13 KiB
Ruby
293 lines
13 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/1.6.4.tar.gz"
|
|
sha256 "16d6a057fd981cd4e5c645db397fb02a6508f5427476544aaeba488fd7798a24"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://github.com/iterative/dvc.git"
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "1a5abba7486ad71d08210a84faabe779134957112e41b5d0e8a056451a2502a2" => :catalina
|
|
sha256 "8b9b5961e6904806e25db1c75b0885d0cd58b2d8903253d0801569dcaded7ff1" => :mojave
|
|
sha256 "bcaaa6a78c04bf54fb7989e79ee973d17376c36a0b8c126122dbdb8be7d18474" => :high_sierra
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "apache-arrow"
|
|
depends_on "openssl@1.1"
|
|
depends_on "python@3.8"
|
|
|
|
resource "appdirs" do
|
|
url "https://files.pythonhosted.org/packages/d7/d8/05696357e0311f5b5c316d7b95f46c669dd9c15aaeecbb48c7d0aeb88c40/appdirs-1.4.4.tar.gz"
|
|
sha256 "7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"
|
|
end
|
|
|
|
resource "atpublic" do
|
|
url "https://files.pythonhosted.org/packages/71/2e/7b45e69d79ffebccad977ad11b03975c88851df2b1635278d8c268eb26df/atpublic-2.0.tar.gz"
|
|
sha256 "ebeb62b71a5c683a84c1b16bbf415708af5a46841b142b85ac3a22ec2d7613b0"
|
|
end
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/40/a7/ded59fa294b85ca206082306bba75469a38ea1c7d44ea7e1d64f5443d67a/certifi-2020.6.20.tar.gz"
|
|
sha256 "5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"
|
|
end
|
|
|
|
resource "chardet" do
|
|
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
|
|
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
|
|
end
|
|
|
|
resource "colorama" do
|
|
url "https://files.pythonhosted.org/packages/82/75/f2a4c0c94c85e2693c229142eb448840fba0f9230111faa889d1f541d12d/colorama-0.4.3.tar.gz"
|
|
sha256 "e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"
|
|
end
|
|
|
|
resource "commonmark" do
|
|
url "https://files.pythonhosted.org/packages/60/48/a60f593447e8f0894ebb7f6e6c1f25dafc5e89c5879fdc9360ae93ff83f0/commonmark-0.9.1.tar.gz"
|
|
sha256 "452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"
|
|
end
|
|
|
|
resource "configobj" do
|
|
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
|
|
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
|
|
end
|
|
|
|
resource "decorator" do
|
|
url "https://files.pythonhosted.org/packages/da/93/84fa12f2dc341f8cf5f022ee09e109961055749df2d0c75c5f98746cfe6c/decorator-4.4.2.tar.gz"
|
|
sha256 "e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7"
|
|
end
|
|
|
|
resource "dictdiffer" do
|
|
url "https://files.pythonhosted.org/packages/08/bf/9e878ffc50cbe57b63b46dee9f7689c8e1d6fa1c6b65f18a582c3e1a5ebd/dictdiffer-0.8.1.tar.gz"
|
|
sha256 "1adec0d67cdf6166bda96ae2934ddb5e54433998ceab63c984574d187cc563d2"
|
|
end
|
|
|
|
resource "distro" do
|
|
url "https://files.pythonhosted.org/packages/a6/a4/75064c334d8ae433445a20816b788700db1651f21bdb0af33db2aab142fe/distro-1.5.0.tar.gz"
|
|
sha256 "0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"
|
|
end
|
|
|
|
resource "dpath" do
|
|
url "https://files.pythonhosted.org/packages/60/3f/562b045ad2542ab1279bbc5a05a62511c1ea1d8b5987fb0a50ee78704621/dpath-2.0.1.tar.gz"
|
|
sha256 "bea06b5f4ff620a28dfc9848cf4d6b2bfeed34238edeb8ebe815c433b54eb1fa"
|
|
end
|
|
|
|
resource "flatten-json" do
|
|
url "https://files.pythonhosted.org/packages/49/e1/02d1f28a0276c0018c5dbe09929b12953c7c6a6d6b887686492ce53278a1/flatten_json-0.1.7.tar.gz"
|
|
sha256 "06341ba64baf2fd9b960b4cacf3d3bab38e1e09a855d9902e79cfd2fe66fa29c"
|
|
end
|
|
|
|
resource "flufl.lock" do
|
|
url "https://files.pythonhosted.org/packages/1e/68/393c148df629f90a919de653ebb967a8bd8c83d07d2bc3150ca0faff3940/flufl.lock-3.2.tar.gz"
|
|
sha256 "a8d66accc9ab41f09961cd8f8db39f9c28e97e2769659a3567c63930a869ff5b"
|
|
end
|
|
|
|
resource "funcy" do
|
|
url "https://files.pythonhosted.org/packages/ce/4b/6ffa76544e46614123de31574ad95758c421aae391a1764921b8a81e1eae/funcy-1.14.tar.gz"
|
|
sha256 "75ee84c3b446f92e68a857c2267b15a1b49c631c9d5a87a5f063cd2d6761a5c4"
|
|
end
|
|
|
|
resource "future" do
|
|
url "https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz"
|
|
sha256 "b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"
|
|
end
|
|
|
|
resource "gitdb" do
|
|
url "https://files.pythonhosted.org/packages/d1/05/eaf2ac564344030d8b3ce870b116d7bb559020163e80d9aa4a3d75f3e820/gitdb-4.0.5.tar.gz"
|
|
sha256 "c9e1f2d0db7ddb9a704c2a0217be31214e91a4fe1dea1efad19ae42ba0c285c9"
|
|
end
|
|
|
|
resource "GitPython" do
|
|
url "https://files.pythonhosted.org/packages/53/ea/fc34cddaa30bfc5e283f13e754fb3e2648ccd9f7019eaa3518fb5350ae51/GitPython-3.1.7.tar.gz"
|
|
sha256 "2db287d71a284e22e5c2846042d0602465c7434d910406990d5b74df4afb0858"
|
|
end
|
|
|
|
resource "grandalf" do
|
|
url "https://files.pythonhosted.org/packages/a2/3f/df0618a962a1744e932f2a4547cb786f5a93df7e2476c99e7f7dbd68039f/grandalf-0.6.tar.gz"
|
|
sha256 "7471db231bd7338bc0035b16edf0dc0c900c82d23060f4b4d0c4304caedda6e4"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
|
|
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
|
|
end
|
|
|
|
resource "jsonpath-ng" do
|
|
url "https://files.pythonhosted.org/packages/85/24/981fa76e1e415bcceb3a9741d5be04b32c10edd42d88f6783faa750b1239/jsonpath-ng-1.5.1.tar.gz"
|
|
sha256 "77b1f93f4444a50c924cb11cdc273546ff79f41830d485916fc6ddf4e0c1ce55"
|
|
end
|
|
|
|
resource "nanotime" do
|
|
url "https://files.pythonhosted.org/packages/d5/54/6d5924f59cf671326e7809f4b3f70fa8df535d67e952ad0b6fea02f52faf/nanotime-0.5.2.tar.gz"
|
|
sha256 "c7cc231fc5f6db401b448d7ab51c96d0a4733f4b69fabe569a576f89ffdf966b"
|
|
end
|
|
|
|
resource "networkx" do
|
|
url "https://files.pythonhosted.org/packages/bf/63/7b579dd3b1c49ce6b7fd8f6f864038f255201410905dd183cf7f4a3845cf/networkx-2.4.tar.gz"
|
|
sha256 "f8f4ff0b6f96e4f9b16af6b84622597b5334bf9cae8cf9b2e42e7985d5c95c64"
|
|
end
|
|
|
|
resource "packaging" do
|
|
url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz"
|
|
sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"
|
|
end
|
|
|
|
resource "pathspec" do
|
|
url "https://files.pythonhosted.org/packages/93/9c/4bb0a33b0ec07d2076f0b3d7c6aae4dad0a99f9a7a14f7f7ff6f4ed7fa38/pathspec-0.8.0.tar.gz"
|
|
sha256 "da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"
|
|
end
|
|
|
|
resource "ply" do
|
|
url "https://files.pythonhosted.org/packages/e5/69/882ee5c9d017149285cab114ebeab373308ef0f874fcdac9beb90e0ac4da/ply-3.11.tar.gz"
|
|
sha256 "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"
|
|
end
|
|
|
|
resource "pyasn1" do
|
|
url "https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz"
|
|
sha256 "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"
|
|
end
|
|
|
|
resource "pydot" do
|
|
url "https://files.pythonhosted.org/packages/5f/e2/23e053ccf5648153959ea15d77fb90adb2b1f9c9360f832f39d6d6c024e2/pydot-1.4.1.tar.gz"
|
|
sha256 "d49c9d4dd1913beec2a997f831543c8cbd53e535b1a739e921642fe416235f01"
|
|
end
|
|
|
|
resource "Pygments" do
|
|
url "https://files.pythonhosted.org/packages/6e/4d/4d2fe93a35dfba417311a4ff627489a947b01dc0cc377a3673c00cf7e4b2/Pygments-2.6.1.tar.gz"
|
|
sha256 "647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44"
|
|
end
|
|
|
|
resource "pygtrie" do
|
|
url "https://files.pythonhosted.org/packages/18/41/2e5cefc895a32d9ca0f3574bd0df09e53a697023579a93582bedc4eeac4d/pygtrie-2.3.2.tar.gz"
|
|
sha256 "6299cdedd2cbdfda0895c2dbc43efe8828e698c62b574f3ef7e14b3253f80e23"
|
|
end
|
|
|
|
resource "pyparsing" do
|
|
url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz"
|
|
sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/da/67/672b422d9daf07365259958912ba533a0ecab839d4084c487a5fe9a5405f/requests-2.24.0.tar.gz"
|
|
sha256 "b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"
|
|
end
|
|
|
|
resource "rich" do
|
|
url "https://files.pythonhosted.org/packages/e8/a1/eb2c0fdc7e223dacd7441495c4e12d616bbbecebd403efc96b7208269159/rich-6.0.0.tar.gz"
|
|
sha256 "53c683a79e3f949d675b1d04e6fe3ccd53fad97aa7e2f6a83f2985502663f420"
|
|
end
|
|
|
|
resource "ruamel.yaml" do
|
|
url "https://files.pythonhosted.org/packages/16/8b/54a26c1031595e5edd0e616028b922d78d8ffba8bc775f0a4faeada846cc/ruamel.yaml-0.16.10.tar.gz"
|
|
sha256 "099c644a778bf72ffa00524f78dd0b6476bca94a1da344130f4bf3381ce5b954"
|
|
end
|
|
|
|
resource "ruamel.yaml.clib" do
|
|
url "https://files.pythonhosted.org/packages/92/28/612085de3fae9f82d62d80255d9f4cf05b1b341db1e180adcf28c1bf748d/ruamel.yaml.clib-0.2.0.tar.gz"
|
|
sha256 "b66832ea8077d9b3f6e311c4a53d06273db5dc2db6e8a908550f3c14d67e718c"
|
|
end
|
|
|
|
resource "shortuuid" do
|
|
url "https://files.pythonhosted.org/packages/6f/e0/a881ca1332e9195acb4c2b912d58a4278f6950e118b628188e2bc8830589/shortuuid-1.0.1.tar.gz"
|
|
sha256 "3c11d2007b915c43bee3e10625f068d8a349e04f0d81f08f5fa08507427ebf1f"
|
|
end
|
|
|
|
resource "shtab" do
|
|
url "https://files.pythonhosted.org/packages/29/d2/9e57be722dc8d1e42001e958e92285d3139c66ec8a246e7096b9e783f05f/shtab-1.3.1.tar.gz"
|
|
sha256 "a6f8eacf6ade37331e157498d1b21b6e47f132204becff5920c1886ac65faf64"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
|
|
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
|
|
end
|
|
|
|
resource "smmap" do
|
|
url "https://files.pythonhosted.org/packages/75/fb/2f594e5364f9c986b2c89eb662fc6067292cb3df2b88ae31c939b9138bb9/smmap-3.0.4.tar.gz"
|
|
sha256 "9c98bbd1f9786d22f14b3d4126894d56befb835ec90cef151af566c7e19b5d24"
|
|
end
|
|
|
|
resource "tabulate" do
|
|
url "https://files.pythonhosted.org/packages/57/6f/213d075ad03c84991d44e63b6516dd7d185091df5e1d02a660874f8f7e1e/tabulate-0.8.7.tar.gz"
|
|
sha256 "db2723a20d04bcda8522165c73eea7c300eda74e0ce852d9022e0159d7895007"
|
|
end
|
|
|
|
resource "toml" do
|
|
url "https://files.pythonhosted.org/packages/da/24/84d5c108e818ca294efe7c1ce237b42118643ce58a14d2462b3b2e3800d5/toml-0.10.1.tar.gz"
|
|
sha256 "926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f"
|
|
end
|
|
|
|
resource "tqdm" do
|
|
url "https://files.pythonhosted.org/packages/7c/a2/4cc95d7766a5d17ea2541d88da357d5905f75b6dbdfd17dfffd6c37647ae/tqdm-4.48.2.tar.gz"
|
|
sha256 "564d632ea2b9cb52979f7956e093e831c28d441c11751682f84c86fc46e4fd21"
|
|
end
|
|
|
|
resource "typing-extensions" do
|
|
url "https://files.pythonhosted.org/packages/16/06/0f7367eafb692f73158e5c5cbca1aec798cdf78be5167f6415dd4205fa32/typing_extensions-3.7.4.3.tar.gz"
|
|
sha256 "99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/81/f4/87467aeb3afc4a6056e1fe86626d259ab97e1213b1dfec14c7cb5f538bf0/urllib3-1.25.10.tar.gz"
|
|
sha256 "91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a"
|
|
end
|
|
|
|
resource "voluptuous" do
|
|
url "https://files.pythonhosted.org/packages/24/3b/fe531688c0d9e057fccc0bc9430c0a3d4b90e0d2f015326e659c2944e328/voluptuous-0.11.7.tar.gz"
|
|
sha256 "2abc341dbc740c5e2302c7f9b8e2e243194fb4772585b991931cb5b22e9bf456"
|
|
end
|
|
|
|
resource "zc.lockfile" do
|
|
url "https://files.pythonhosted.org/packages/11/98/f21922d501ab29d62665e7460c94f5ed485fd9d8348c126697947643a881/zc.lockfile-2.0.tar.gz"
|
|
sha256 "307ad78227e48be260e64896ec8886edc7eae22d8ec53e4d528ab5537a83203b"
|
|
end
|
|
|
|
def install
|
|
venv = virtualenv_create(libexec, Formula["python@3.8"].opt_bin/"python3")
|
|
|
|
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",
|
|
# NOTE: building rich requires poetry, which is problematic.
|
|
# See https://github.com/Homebrew/homebrew-core/pull/58501
|
|
"--only-binary", "rich",
|
|
"--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,gdrive,webdav]"
|
|
|
|
# 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/"dvc").write `#{bin}/dvc completion -s bash`
|
|
(zsh_completion/"_dvc").write `#{bin}/dvc completion -s zsh`
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/dvc", "version"
|
|
end
|
|
end
|