Skip to content

Commit 46760ca

Browse files
MarkusCopilot
andcommitted
refactor: move INTEGRATION_JSON to top-level constants module
Move INTEGRATION_JSON from specify_cli.workflows.constants to specify_cli.constants to avoid importing the workflows package when the main CLI module loads. Update imports in __init__.py and workflows/engine.py accordingly, and remove the now-empty workflows/constants.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2322fdb commit 46760ca

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@
5757
# For cross-platform keyboard input
5858
import readchar
5959

60-
# Keep this local so importing specify_cli does not import the workflows package
61-
# (whose package initialization registers steps and imports all workflow modules).
62-
INTEGRATION_JSON = ".specify/integration.json"
60+
from .constants import INTEGRATION_JSON
6361

6462
GITHUB_API_LATEST = "https://api.github.com/repos/github/spec-kit/releases/latest"
6563

src/specify_cli/constants.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Top-level constants shared by the CLI and the workflow engine.
2+
3+
This module is dependency-free (no typer, no rich, no workflow imports), so it
4+
can be imported from anywhere inside the package without triggering side effects.
5+
"""
6+
7+
INTEGRATION_JSON = ".specify/integration.json"

src/specify_cli/workflows/constants.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/specify_cli/workflows/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import yaml
2121

2222
from .base import RunStatus, StepContext, StepResult, StepStatus
23-
from .constants import INTEGRATION_JSON
23+
from specify_cli.constants import INTEGRATION_JSON
2424

2525

2626
# -- Workflow Definition --------------------------------------------------

0 commit comments

Comments
 (0)