Skip to content

Commit

Permalink
Adjusted viv to install from git instead of release to include .git d…
Browse files Browse the repository at this point in the history
…irectory for Docker.
  • Loading branch information
GatlenCulp committed Sep 15, 2024
1 parent 8509811 commit 1f5a967
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Formula/vivaria.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
class Vivaria < Formula
include Language::Python::Virtualenv
desc "Task environment setup tool for AI research"
# AUTHORS: METR <[email protected]>
homepage "https://vivaria.metr.org/"
url "https://github.com/GatlenCulp/vivaria/archive/refs/tags/v0.1.2.tar.gz"#, tag: "v0.1.0"

# url "https://github.com/GatlenCulp/vivaria/archive/refs/tags/v0.1.2.tar.gz"#, tag: "v0.1.0"
# sha256 "2ad566ffd8836670dd5a5639b8f30efbbedf0fb76d250315aae9b38085188042"

# Need this for .git directory to be included in the installation
url "https://github.com/GatlenCulp/vivaria.git",
using: :git,

Check failure on line 11 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/HashAlignment: Align the keys and values of a hash literal if they span more than one line.

Check failure on line 11 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/HashAlignment: Align the keys and values of a hash literal if they span more than one line.
tag: "v0.1.2"

Check failure on line 12 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/HashAlignment: Align the keys and values of a hash literal if they span more than one line.

Check failure on line 12 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/HashAlignment: Align the keys and values of a hash literal if they span more than one line.
# revision: "abcdef1234567890abcdef1234567890abcdef12"

Check failure on line 13 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/CommentIndentation: Incorrect indentation detected (column 6 instead of 2).

Check failure on line 13 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/CommentIndentation: Incorrect indentation detected (column 6 instead of 2).

Check failure on line 14 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 14 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
version "0.1.0" # TODO: Grab the version from the tag(?)
sha256 "2ad566ffd8836670dd5a5639b8f30efbbedf0fb76d250315aae9b38085188042"
license "MIT"
head "https://github.com/METR/vivaria.git", branch: "main"

Expand Down Expand Up @@ -91,6 +98,7 @@ class Vivaria < Formula
sha256 "e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"
end


Check failure on line 101 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 101 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
def install
# Install dependencies and the CLI in a virtualenv
venv = virtualenv_create(libexec/"venv", "python3.11")
Expand All @@ -101,15 +109,15 @@ def install
bin.install libexec / "venv/bin/viv"
bin.install "scripts/setup-docker-compose.sh" => "viv-setup-docker"
bin.install "scripts/configure-cli-for-docker-compose.sh" => "viv-setup-cli"

Check failure on line 112 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 112 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
# Install everything in docs as well as the README, CHANGELOG, LICENSE, and CONTRIBUTING
doc.install Dir["docs/*"]
doc.install "README.md"
doc.install "LICENSE"
doc.install "CONTRIBUTING.md"

Check failure on line 118 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 118 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
# Setup script that combines the two and sets up the environment

Check failure on line 120 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 120 in Formula/vivaria.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
# Clean up unnecessary directories
rm_rf ".devcontainer"
rm_rf ".github"
Expand All @@ -122,10 +130,6 @@ def install
src_dir = prefix/"vivaria"
src_dir.mkpath
src_dir.install Dir["*", ".*"].reject { |f| ['.', '..'].include?(File.basename(f)) }
# Include .git directory for development
src_dir.install ".git"
# prefix.install Dir["*"]
# prefix.install Dir[".*"].select { |f| File.file?(f) }

# Make viv-docker command available which sends commands to docker

Expand All @@ -134,8 +138,8 @@ def install

def post_install
# This is helpful for using brew api postinstall and making on-the-fly changes

src_dir.install buildpath / ".git"
# src_dir = prefix / "vivaria"
# src_dir.install buildpath / ".git"

# Run with brew postinstall vivaria
# Idk if this is the best way to do this but it works for now.
Expand Down

0 comments on commit 1f5a967

Please sign in to comment.