From f03f0b7a6eda3dfd7d348f6a1efc75fa9aeabf7d Mon Sep 17 00:00:00 2001 From: Adam Stus Date: Mon, 26 Feb 2024 13:47:08 +0100 Subject: [PATCH] Snowflake-cli formula python 3.12 fix (#20) --- Formula/snowflake-cli.rb | 9 ++++----- Formula/snowflake-cli.tmpl.rb | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Formula/snowflake-cli.rb b/Formula/snowflake-cli.rb index 7bd1b28..fcb3dfe 100644 --- a/Formula/snowflake-cli.rb +++ b/Formula/snowflake-cli.rb @@ -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 diff --git a/Formula/snowflake-cli.tmpl.rb b/Formula/snowflake-cli.tmpl.rb index 27071f5..22919dd 100644 --- a/Formula/snowflake-cli.tmpl.rb +++ b/Formula/snowflake-cli.tmpl.rb @@ -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