Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1639544: use new pypi repository name for installation #36

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Formula/snowcli.tmpl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def install
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "ensurepip", "--upgrade"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "snowflake-cli-labs=={{ version }}"
"-m", "pip", "install", "snowflake-cli=={{ version }}"
bin.install_symlink "#{libexec}/bin/snow" => "snow"
end

test do
false
end
end
end
4 changes: 2 additions & 2 deletions Formula/snowflake-cli.tmpl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def install
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "ensurepip", "--upgrade"
venv.instance_variable_get(:@formula).system venv.instance_variable_get(:@venv_root)/"bin/python",
"-m", "pip", "install", "snowflake-cli-labs=={{ version }}"
"-m", "pip", "install", "snowflake-cli=={{ version }}"
bin.install_symlink "#{libexec}/bin/snow" => "snow"
end

test do
false
end
end
end
24 changes: 15 additions & 9 deletions update-snowcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ def main():
loader=jinja2.loaders.FileSystemLoader(Path(__file__).parent)
)
template = env.get_template("Formula/snowcli.tmpl.rb")
packages = subprocess.check_output(["poet", "snowflake-cli-labs"], encoding="utf-8")
packages = subprocess.check_output(["poet", "snowflake-cli"], encoding="utf-8")

sf_pattern = r'\s+resource \"snowflake-cli-labs\" do\s+url \"(.+)\"\s+sha256 \"(\w+)\"\s+end\n'
sf_pattern = (
r"\s+resource \"snowflake-cli\" do\s+url \"(.+)\"\s+sha256 \"(\w+)\"\s+end\n"
)
match = re.findall(sf_pattern, packages)
if not match:
raise ValueError("snowflake dependency not present in deps")
sf_url, sf_sha = match[0]

version = subprocess.check_output(["snow", "--version"], encoding="utf-8").split()[-1]
version = subprocess.check_output(["snow", "--version"], encoding="utf-8").split()[
-1
]

with open("Formula/snowcli.rb", "w+") as fh:
fh.write(template.render(
sf_url=sf_url,
sf_sha=sf_sha,
version=version,
))
fh.write(
template.render(
sf_url=sf_url,
sf_sha=sf_sha,
version=version,
)
)


if __name__ == '__main__':
if __name__ == "__main__":
main()
24 changes: 15 additions & 9 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@ def main():
loader=jinja2.loaders.FileSystemLoader(Path(__file__).parent)
)
template = env.get_template("Formula/snowflake-cli.tmpl.rb")
packages = subprocess.check_output(["poet", "snowflake-cli-labs"], encoding="utf-8")
packages = subprocess.check_output(["poet", "snowflake-cli"], encoding="utf-8")

sf_pattern = r'\s+resource \"snowflake-cli-labs\" do\s+url \"(.+)\"\s+sha256 \"(\w+)\"\s+end\n'
sf_pattern = (
r"\s+resource \"snowflake-cli\" do\s+url \"(.+)\"\s+sha256 \"(\w+)\"\s+end\n"
)
match = re.findall(sf_pattern, packages)
if not match:
raise ValueError("snowflake dependency not present in deps")
sf_url, sf_sha = match[0]

version = subprocess.check_output(["snow", "--version"], encoding="utf-8").split()[-1]
version = subprocess.check_output(["snow", "--version"], encoding="utf-8").split()[
-1
]

with open("Formula/snowflake-cli.rb", "w+") as fh:
fh.write(template.render(
sf_url=sf_url,
sf_sha=sf_sha,
version=version,
))
fh.write(
template.render(
sf_url=sf_url,
sf_sha=sf_sha,
version=version,
)
)


if __name__ == '__main__':
if __name__ == "__main__":
main()