Skip to content

Commit

Permalink
Snowflake-cli formula python 3.12 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Feb 26, 2024
1 parent 958333a commit 1778de2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions Formula/snowflake-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ class SnowflakeCli < Formula

def install
ENV["CARGO_NET_GIT_FETCH_WITH_CLI"] = "true"
#without_pip=false because of https://github.com/Homebrew/brew/pull/15792
venv = virtualenv_create(libexec, "python3", system_site_packages: false, without_pip: false)
venv = virtualenv_create(libexec, "python3", system_site_packages: false)
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "pip==22.3.1"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/pip",
"install", "snowflake-cli-labs==2.0.0"
"-m", "ensurepip", "--upgrade"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "snowflake-cli-labs==2.0.0"
bin.install_symlink "#{libexec}/bin/snow" => "snow"
end

Expand Down
9 changes: 4 additions & 5 deletions Formula/snowflake-cli.tmpl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ class SnowflakeCli < Formula

def install
ENV["CARGO_NET_GIT_FETCH_WITH_CLI"] = "true"
#without_pip=false because of https://github.com/Homebrew/brew/pull/15792
venv = virtualenv_create(libexec, "python3", system_site_packages: false, without_pip: false)
venv = virtualenv_create(libexec, "python3", system_site_packages: false)
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "pip==22.3.1"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/pip",
"install", "snowflake-cli-labs=={{ version }}"
"-m", "ensurepip", "--upgrade"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "snowflake-cli-labs=={{ version }}"
bin.install_symlink "#{libexec}/bin/snow" => "snow"
end

Expand Down

0 comments on commit 1778de2

Please sign in to comment.