From 6418470ee569ae4da95043e1471ec90c5e36c3e2 Mon Sep 17 00:00:00 2001 From: Marcin Raba Date: Fri, 20 Sep 2024 10:33:32 +0200 Subject: [PATCH] SNOW-1639544: snowflake-cli tests update --- README.md | 12 +++++------- src/snowflake/cli/_app/version_check.py | 2 +- test_external_plugins/broken_plugin/pyproject.toml | 4 +--- test_external_plugins/failing_plugin/pyproject.toml | 4 +--- .../multilingual_hello_command_group/pyproject.toml | 4 +--- .../override_build_in_command/pyproject.toml | 4 +--- .../snowpark_hello_single_command/pyproject.toml | 4 +--- tests/app/test_version_check.py | 2 +- 8 files changed, 12 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 23ed832673..d2af3ccc28 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,13 @@ Snowflake CLI is an open-source command-line tool explicitly designed for develo With Snowflake CLI, developers can create, manage, update, and view apps running on Snowflake across workloads such as Streamlit in Snowflake, the Snowflake Native App Framework, Snowpark Container Services, and Snowpark. It supports a range of Snowflake features, including user-defined functions, stored procedures, Streamlit in Snowflake, and SQL execution. - **Note**: Snowflake CLI is in Public Preview (PuPr). -Docs: https://docs.snowflake.com/en/developer-guide/snowflake-cli-v2/index. - -Quick start: https://quickstarts.snowflake.com/guide/getting-started-with-snowflake-cli +Docs: . -Cheatsheet: https://github.com/Snowflake-Labs/sf-cheatsheets/blob/main/snowflake-cli.md +Quick start: +Cheatsheet: ## Install Snowflake CLI @@ -43,7 +41,7 @@ Cheatsheet: https://github.com/Snowflake-Labs/sf-cheatsheets/blob/main/snowflake We recommend installing Snowflake CLI in isolated environment using [pipx](https://pipx.pypa.io/stable/). Requires Python >= 3.10 ```bash -pipx install snowflake-cli-labs +pipx install snowflake-cli snow --help ``` @@ -76,4 +74,4 @@ You should now be able to run `snow` and get the CLI message. ## Get involved Have a feature idea? Running into a bug? Want to contribute? We'd love to hear from you! -Please open or review issues, open pull requests, or reach out to us on developers@snowflake.com +Please open or review issues, open pull requests, or reach out to us on diff --git a/src/snowflake/cli/_app/version_check.py b/src/snowflake/cli/_app/version_check.py index 3c97fa5aa7..f404a90c95 100644 --- a/src/snowflake/cli/_app/version_check.py +++ b/src/snowflake/cli/_app/version_check.py @@ -46,7 +46,7 @@ def _save_latest_version(self, version: str): def _get_version_from_pypi() -> str | None: headers = {"Content-Type": "application/vnd.pypi.simple.v1+json"} response = requests.get( - "https://pypi.org/pypi/snowflake-cli-labs/json", headers=headers, timeout=3 + "https://pypi.org/pypi/snowflake-cli/json", headers=headers, timeout=3 ) response.raise_for_status() return response.json()["info"]["version"] diff --git a/test_external_plugins/broken_plugin/pyproject.toml b/test_external_plugins/broken_plugin/pyproject.toml index a0d1e3ccbe..fe16133cf3 100644 --- a/test_external_plugins/broken_plugin/pyproject.toml +++ b/test_external_plugins/broken_plugin/pyproject.toml @@ -19,9 +19,7 @@ build-backend = "setuptools.build_meta" [project] name = "override-build-in-commands" requires-python = ">=3.8" -dependencies = [ - "snowflake-cli-labs>=2.0.0" -] +dependencies = ["snowflake-cli>=2.0.0"] version = "0.0.1" [project.entry-points."snowflake.cli.plugin.command"] diff --git a/test_external_plugins/failing_plugin/pyproject.toml b/test_external_plugins/failing_plugin/pyproject.toml index 325f501cc2..1a567938f3 100644 --- a/test_external_plugins/failing_plugin/pyproject.toml +++ b/test_external_plugins/failing_plugin/pyproject.toml @@ -19,9 +19,7 @@ build-backend = "setuptools.build_meta" [project] name = "override-build-in-commands" requires-python = ">=3.8" -dependencies = [ - "snowflake-cli-labs>=2.0.0" -] +dependencies = ["snowflake-cli>=2.0.0"] version = "0.0.1" [project.entry-points."snowflake.cli.plugin.command"] diff --git a/test_external_plugins/multilingual_hello_command_group/pyproject.toml b/test_external_plugins/multilingual_hello_command_group/pyproject.toml index 88660c6e3f..e9dd1e2349 100644 --- a/test_external_plugins/multilingual_hello_command_group/pyproject.toml +++ b/test_external_plugins/multilingual_hello_command_group/pyproject.toml @@ -19,9 +19,7 @@ build-backend = "setuptools.build_meta" [project] name = "snowflakecli-test-multilingual-hello-plugin" requires-python = ">=3.8" -dependencies = [ - "snowflake-cli-labs>=1.1.0" -] +dependencies = ["snowflake-cli>=1.1.0"] version = "0.0.1" [project.entry-points."snowflake.cli.plugin.command"] diff --git a/test_external_plugins/override_build_in_command/pyproject.toml b/test_external_plugins/override_build_in_command/pyproject.toml index 5bbd8b905f..4e2fb98626 100644 --- a/test_external_plugins/override_build_in_command/pyproject.toml +++ b/test_external_plugins/override_build_in_command/pyproject.toml @@ -19,9 +19,7 @@ build-backend = "setuptools.build_meta" [project] name = "override-build-in-commands" requires-python = ">=3.8" -dependencies = [ - "snowflake-cli-labs>=1.1.0" -] +dependencies = ["snowflake-cli>=1.1.0"] version = "0.0.1" [project.entry-points."snowflake.cli.plugin.command"] diff --git a/test_external_plugins/snowpark_hello_single_command/pyproject.toml b/test_external_plugins/snowpark_hello_single_command/pyproject.toml index df24c07419..f83c3e2a4c 100644 --- a/test_external_plugins/snowpark_hello_single_command/pyproject.toml +++ b/test_external_plugins/snowpark_hello_single_command/pyproject.toml @@ -19,9 +19,7 @@ build-backend = "setuptools.build_meta" [project] name = "snowflakecli-test-snowpark-hello-plugin" requires-python = ">=3.8" -dependencies = [ - "snowflake-cli-labs>=1.1.0" -] +dependencies = ["snowflake-cli>=1.1.0"] version = "0.0.1" [project.entry-points."snowflake.cli.plugin.command"] diff --git a/tests/app/test_version_check.py b/tests/app/test_version_check.py index 9f64619623..7544c983b6 100644 --- a/tests/app/test_version_check.py +++ b/tests/app/test_version_check.py @@ -93,7 +93,7 @@ def test_get_version_from_pypi(mock_get): mock_get.return_value = r assert _VersionCache()._get_version_from_pypi() == "1.2.3" # noqa mock_get.assert_called_once_with( - "https://pypi.org/pypi/snowflake-cli-labs/json", + "https://pypi.org/pypi/snowflake-cli/json", headers={"Content-Type": "application/vnd.pypi.simple.v1+json"}, timeout=3, )