-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-telemetry
- Loading branch information
Showing
19 changed files
with
241 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from __future__ import annotations | ||
|
||
VERSION = "2.0.0rc3" | ||
VERSION = "2.0.1rc0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test_external_plugins/override_build_in_command/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "override-build-in-commands" | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"snowflake-cli-labs>=1.1.0" | ||
] | ||
version = "0.0.1" | ||
|
||
[project.entry-points."snowflake.cli.plugin.command"] | ||
override = "snowflakecli.test_plugins.override_build_in_command.plugin_spec" |
Empty file.
13 changes: 13 additions & 0 deletions
13
...ride_build_in_command/src/snowflakecli/test_plugins/override_build_in_command/commands.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import typer | ||
from snowflake.cli.api.commands.decorators import ( | ||
with_output, | ||
) | ||
from snowflake.cli.api.output.types import CommandResult, MessageResult | ||
|
||
app = typer.Typer() | ||
|
||
|
||
@app.command("add") | ||
@with_output | ||
def add() -> CommandResult: | ||
return MessageResult("This message should not be printed") |
16 changes: 16 additions & 0 deletions
16
...e_build_in_command/src/snowflakecli/test_plugins/override_build_in_command/plugin_spec.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from snowflake.cli.api.plugins.command import ( | ||
CommandPath, | ||
CommandSpec, | ||
CommandType, | ||
plugin_hook_impl, | ||
) | ||
from snowflakecli.test_plugins.override_build_in_command import commands | ||
|
||
|
||
@plugin_hook_impl | ||
def command_spec(): | ||
return CommandSpec( | ||
parent_command_path=CommandPath(["connection"]), | ||
command_type=CommandType.SINGLE_COMMAND, | ||
typer_instance=commands.app, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[cli.plugins.override] | ||
enabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
def test_override_build_in_commands(runner, test_root_path, caplog): | ||
import subprocess | ||
|
||
path = test_root_path / ".." / "test_external_plugins" / "override_build_in_command" | ||
subprocess.check_call(["pip", "install", path]) | ||
|
||
config_path = ( | ||
test_root_path / "test_data" / "configs" / "override_plugin_config.toml" | ||
) | ||
|
||
runner.invoke(["--config-file", config_path, "--help"]) | ||
|
||
assert ( | ||
caplog.messages[0] | ||
== "Cannot register plugin [override]: Cannot add command [snow connection add] because it already exists." | ||
) |
Oops, something went wrong.