Skip to content

Commit

Permalink
Create new subpackage for app's internal modules (snowflakedb#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pjob committed Sep 7, 2023
1 parent 835bd7a commit 4ea8641
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 10 deletions.
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/pycharm_remote_debug.py
exclude: src/snowcli/app/dev/pycharm_remote_debug.py
- id: check-ast
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.217"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dev = [
"Bug Tracker" = "https://github.com/Snowflake-Labs/snowcli/issues"

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

[tool.hatch.version]
path = "src/snowcli/__about__.py"
Expand Down
2 changes: 1 addition & 1 deletion snowcli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ block_cipher = None


a = Analysis(
['src/snowcli/cli/__init__.py'],
['src/snowcli/app/__main__.py'],
pathex=[],
binaries=[],
datas=[('src/templates', 'templates'), ('src/snowcli', 'snowcli')],
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/snowcli/__main__.py → src/snowcli/app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

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


def main(*args):
Expand Down
8 changes: 5 additions & 3 deletions src/snowcli/cli/app.py → src/snowcli/app/cli_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import click

from snowcli import __about__
from snowcli.cli.main.snow_cli_main_typer import SnowCliMainTyper
from snowcli.app.main_typer import SnowCliMainTyper
from snowcli.config import config_init, cli_config
from snowcli.docs.generator import generate_docs
from snowcli.app.dev.docs.generator import generate_docs
from snowcli.output.formats import OutputFormat
from snowcli.output.printing import OutputData
from snowcli.pycharm_remote_debug import setup_pycharm_remote_debugger_if_provided
from snowcli.app.dev.pycharm_remote_debug import (
setup_pycharm_remote_debugger_if_provided,
)

app: SnowCliMainTyper = SnowCliMainTyper()
log = logging.getLogger(__name__)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_info_callback(runner):


def test_all_commands_has_proper_documentation():
from snowcli.cli.app import app
from snowcli.app.cli_app import app

ctx = click.Context(get_command(app))
errors = []
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_utils/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def package_file():

@pytest.fixture(scope="function")
def runner(test_snowcli_config):
from snowcli.cli.app import app
from snowcli.app.cli_app import app

return SnowCLIRunner(app, test_snowcli_config)

Expand Down
2 changes: 1 addition & 1 deletion tests_integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from dataclasses import dataclass
from pathlib import Path
from snowcli.cli.app import app
from snowcli.app.cli_app import app
from tempfile import NamedTemporaryFile
from typer import Typer
from typer.testing import CliRunner
Expand Down

0 comments on commit 4ea8641

Please sign in to comment.