Skip to content

Commit

Permalink
[SNOW-919111] src/snowcli -> src/snowflake/cli, src/templates -> src/…
Browse files Browse the repository at this point in the history
…snowflake/cli/templates (snowflakedb#662)

* Checking existance of file from template in e2e tests

* src/snowcli -> src/snowflake/cli, src/templates -> src/snowflake/cli/templates
  • Loading branch information
sfc-gh-pjob authored Jan 18, 2024
1 parent f83ef7e commit 4560733
Show file tree
Hide file tree
Showing 211 changed files with 618 additions and 533 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
* @sfc-gh-turbaszek @sfc-gh-pjob @sfc-gh-jsikorski @sfc-gh-astus

# Native Apps Owners
src/snowcli/plugins/nativeapp/ @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
src/snowflake/cli/plugins/nativeapp/ @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
tests/nativeapp/ @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
tests_integration/test_nativeapp.py @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi

# Project Definition Owners
src/snowcli/api/project/schemas/native_app.py @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
src/snowflake/cli/api/project/schemas/native_app.py @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
tests/project/ @sfc-gh-turbaszek @sfc-gh-pjob @sfc-gh-jsikorski @sfc-gh-astus @sfc-gh-bgoel @sfc-gh-cgorrie @sfc-gh-bdufour @sfc-gh-melnacouzi
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: check-yaml
exclude: .github/repo_meta.yaml
- id: debug-statements
exclude: src/snowcli/app/dev/pycharm_remote_debug.py
exclude: src/snowflake/cli/app/dev/pycharm_remote_debug.py
- id: check-ast
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.7"
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ dev = [
"Bug Tracker" = "https://github.com/Snowflake-Labs/snowcli/issues"

[project.scripts]
snow = "snowcli.app.__main__:main"
snow = "snowflake.cli.app.__main__:main"

[tool.hatch.version]
path = "src/snowcli/__about__.py"
path = "src/snowflake/cli/__about__.py"

[tool.hatch.build.targets.sdist]
exclude = ["/.github"]

[tool.hatch.build.targets.wheel]
packages = ["src/snowcli", "src/templates"]
packages = ["src/snowflake"]

[tool.ruff]
line-length = 88
Expand Down
4 changes: 2 additions & 2 deletions snowcli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ block_cipher = None


a = Analysis(
['src/snowcli/app/__main__.py'],
['src/snowflake/cli/app/__main__.py'],
pathex=[],
binaries=[],
datas=[('src/templates', 'templates'), ('src/snowcli', 'snowcli')],
datas=[('src/snowflake', 'snowflake')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
Expand Down
22 changes: 0 additions & 22 deletions src/snowcli/app/commands_registration/builtin_plugins.py

This file was deleted.

15 changes: 0 additions & 15 deletions src/snowcli/plugins/containers/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/snowcli/plugins/snowpark/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions src/snowcli/plugins/streamlit/plugin_spec.py

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from snowcli.api.plugins.plugin_config import PluginConfigProvider
from snowflake.cli.api.plugins.plugin_config import PluginConfigProvider


class Api:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from pathlib import Path
from typing import Dict, Optional

from snowcli.api.exceptions import InvalidSchemaError
from snowcli.api.output.formats import OutputFormat
from snowflake.cli.api.exceptions import InvalidSchemaError
from snowflake.cli.api.output.formats import OutputFormat
from snowflake.connector import SnowflakeConnection


Expand Down Expand Up @@ -140,7 +140,7 @@ def _collect_not_empty_connection_attributes(self):
return not_empty_attributes

def _build_connection(self):
from snowcli.app.snow_connector import connect_to_snowflake
from snowflake.cli.app.snow_connector import connect_to_snowflake

return connect_to_snowflake(
temporary_connection=self.temporary_connection,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from inspect import Signature
from typing import Callable, Dict, List, Optional, get_type_hints

from snowcli.api.cli_global_context import cli_context
from snowcli.api.commands.flags import (
from snowflake.cli.api.cli_global_context import cli_context
from snowflake.cli.api.commands.flags import (
AccountOption,
AuthenticatorOption,
ConnectionOption,
Expand All @@ -25,9 +25,9 @@
experimental_option,
project_definition_option,
)
from snowcli.api.exceptions import CommandReturnTypeError
from snowcli.api.output.formats import OutputFormat
from snowcli.api.output.types import CommandResult
from snowflake.cli.api.exceptions import CommandReturnTypeError
from snowflake.cli.api.output.formats import OutputFormat
from snowflake.cli.api.output.types import CommandResult


def global_options(func: Callable):
Expand Down Expand Up @@ -96,7 +96,7 @@ def decorator(func: Callable):


def _execute_before_command_using_global_options():
from snowcli.app.loggers import create_loggers
from snowflake.cli.app.loggers import create_loggers

create_loggers(cli_context.verbose, cli_context.enable_tracebacks)

Expand Down Expand Up @@ -266,7 +266,7 @@ def _evaluate_param_type(


def with_output(func):
from snowcli.app.printing import print_result
from snowflake.cli.app.printing import print_result

@wraps(func)
def wrapper(*args, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from snowcli.api.cli_global_context import cli_context
from snowflake.cli.api.cli_global_context import cli_context


def experimental_behaviour_enabled() -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import Any, Callable, Optional

import typer
from snowcli.api.cli_global_context import cli_context_manager
from snowcli.api.output.formats import OutputFormat
from snowflake.cli.api.cli_global_context import cli_context_manager
from snowflake.cli.api.output.formats import OutputFormat

DEFAULT_CONTEXT_SETTINGS = {"help_option_names": ["--help", "-h"]}

Expand Down Expand Up @@ -219,8 +219,8 @@ def execution_identifier_argument(sf_object: str, example: str) -> typer.Argumen


def project_definition_option(project_name: str):
from snowcli.api.exceptions import NoProjectDefinitionError
from snowcli.api.project.definition_manager import DefinitionManager
from snowflake.cli.api.exceptions import NoProjectDefinitionError
from snowflake.cli.api.project.definition_manager import DefinitionManager

def _callback(project_path: Optional[str]):
dm = DefinitionManager(project_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import shutil

from snowcli.api.constants import TEMPLATES_PATH
from snowcli.api.output.types import CommandResult, MessageResult
from snowflake.cli.api.constants import TEMPLATES_PATH
from snowflake.cli.api.output.types import CommandResult, MessageResult
from typer import Argument, Typer


Expand All @@ -16,7 +16,7 @@ def _create_project_template(template_name: str, project_directory: str):


def add_init_command(app: Typer, project_type: str, template: str):
from snowcli.api.commands.decorators import global_options, with_output
from snowflake.cli.api.commands.decorators import global_options, with_output

@app.command()
@with_output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Dict, Optional, Union

import tomlkit
from snowcli.api.exceptions import (
from snowflake.cli.api.exceptions import (
MissingConfiguration,
UnsupportedConfigSectionTypeError,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum
from pathlib import Path

TEMPLATES_PATH = Path(__file__).parent.parent.parent / "templates"
TEMPLATES_PATH = Path(__file__).parent.parent / "templates"
DEPLOYMENT_STAGE = "deployments"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Optional

from click.exceptions import ClickException
from snowcli.api.constants import ObjectType
from snowflake.cli.api.constants import ObjectType


class EnvironmentVariableNotFoundError(ClickException):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from snowcli.api.plugins.command import plugin_hook_spec
from snowflake.cli.api.plugins.command import plugin_hook_spec


@plugin_hook_spec
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pathlib import Path
from typing import Dict, List, Union

from snowcli.api.cli_global_context import cli_context
from snowcli.api.project.schemas.project_definition import (
from snowflake.cli.api.cli_global_context import cli_context
from snowflake.cli.api.project.schemas.project_definition import (
project_override_schema,
project_schema,
)
from snowcli.api.project.util import (
from snowflake.cli.api.project.util import (
append_to_identifier,
clean_identifier,
get_env_username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from pathlib import Path
from typing import List, Optional

from snowcli.api.exceptions import MissingConfiguration
from snowcli.api.project.definition import load_project_definition
from snowflake.cli.api.exceptions import MissingConfiguration
from snowflake.cli.api.project.definition import load_project_definition


def _compat_is_mount(path: Path):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from snowcli.api.project.schemas.relaxed_map import FilePath, Glob, RelaxedMap
from snowcli.api.project.util import (
from snowflake.cli.api.project.schemas.relaxed_map import FilePath, Glob, RelaxedMap
from snowflake.cli.api.project.util import (
IDENTIFIER,
SCHEMA_AND_NAME,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

from snowcli.api.project.schemas import (
from snowflake.cli.api.project.schemas import (
native_app,
snowpark,
streamlit,
)
from snowcli.api.project.schemas.relaxed_map import RelaxedMap
from snowflake.cli.api.project.schemas.relaxed_map import RelaxedMap
from strictyaml import (
Int,
Optional,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from snowcli.api.project.schemas.relaxed_map import RelaxedMap
from snowcli.api.project.util import IDENTIFIER
from snowflake.cli.api.project.schemas.relaxed_map import RelaxedMap
from snowflake.cli.api.project.util import IDENTIFIER
from strictyaml import (
Bool,
EmptyList,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from snowcli.api.project.schemas.relaxed_map import FilePath, RelaxedMap
from snowflake.cli.api.project.schemas.relaxed_map import FilePath, RelaxedMap
from strictyaml import (
Optional,
Seq,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Iterable

from click import ClickException
from snowcli.api.cli_global_context import cli_context
from snowflake.cli.api.cli_global_context import cli_context
from snowflake.connector.cursor import DictCursor, SnowflakeCursor
from snowflake.connector.errors import ProgrammingError

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

from snowcli.app.cli_app import app
from snowflake.cli.app.cli_app import app


def main(*args):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import List

from snowcli.api import PluginConfigProvider
from snowcli.api.config import (
from snowflake.cli.api import PluginConfigProvider
from snowflake.cli.api.config import (
config_section_exists,
get_config_section,
get_config_value,
)
from snowcli.api.plugins.plugin_config import PluginConfig
from snowflake.cli.api.plugins.plugin_config import PluginConfig


class PluginConfigProviderImpl(PluginConfigProvider):
Expand Down
Loading

0 comments on commit 4560733

Please sign in to comment.