From 9f67b5173977601f7ebaf586e098ddb51d586b5f Mon Sep 17 00:00:00 2001 From: Cody Fincher Date: Mon, 7 Jul 2025 15:13:49 +0000 Subject: [PATCH 1/2] fix: correctly launch CLI --- pyproject.toml | 2 +- sqlspec/__main__.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 sqlspec/__main__.py diff --git a/pyproject.toml b/pyproject.toml index e409441b..c3982288 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ test = [ ] [project.scripts] -sqlspec = "sqlspec.cli:run_cli" +sqlspec = "sqlspec.__main__:run_cli" [build-system] build-backend = "hatchling.build" diff --git a/sqlspec/__main__.py b/sqlspec/__main__.py new file mode 100644 index 00000000..ee9a3904 --- /dev/null +++ b/sqlspec/__main__.py @@ -0,0 +1,10 @@ +from sqlspec.cli import add_migration_commands as build_cli_interface + + +def run_cli() -> None: # pragma: no cover + """SQLSpec CLI""" + build_cli_interface()() + + +if __name__ == "__main__": # pragma: no cover + run_cli() From 49b5e568ee286ce7fc93328deedc2922bf885a62 Mon Sep 17 00:00:00 2001 From: Cody Fincher Date: Mon, 7 Jul 2025 15:15:26 +0000 Subject: [PATCH 2/2] fix: formatting --- sqlspec/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlspec/__main__.py b/sqlspec/__main__.py index ee9a3904..a7bed350 100644 --- a/sqlspec/__main__.py +++ b/sqlspec/__main__.py @@ -1,5 +1,7 @@ from sqlspec.cli import add_migration_commands as build_cli_interface +__all__ = ("run_cli", ) + def run_cli() -> None: # pragma: no cover """SQLSpec CLI"""