Skip to content

Commit 851a754

Browse files
committed
fix: extract the 'interactive' module into a separate component, to avoid circular dependencies
1 parent b3acdee commit 851a754

File tree

9 files changed

+12
-8
lines changed

9 files changed

+12
-8
lines changed

bases/polylith/cli/create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
from polylith import project
3+
from polylith import interactive, project
44
from polylith.bricks import base, component
55
from polylith.commands.create import create
66
from polylith.workspace.create import create_workspace
@@ -52,7 +52,7 @@ def project_command(
5252
"""Creates a Polylith project."""
5353
create(name, description, _create_project)
5454

55-
project.interactive.run(name)
55+
interactive.project.run(name)
5656

5757

5858
@app.command("workspace")

components/polylith/commands/sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
from typing import Union
33

4-
from polylith import info, project, sync
4+
from polylith import info, interactive, sync
55

66

77
def is_project_without_bricks(project_data: dict) -> bool:
@@ -17,7 +17,7 @@ def choose_base(root: Path, ns: str, project_data: dict) -> Union[str, None]:
1717
if not possible_bases:
1818
return None
1919

20-
return project.interactive.choose_base_for_project(
20+
return interactive.project.choose_base_for_project(
2121
root, ns, project_data["name"], possible_bases
2222
)
2323

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from polylith.interactive import project
2+
3+
__all__ = ["project"]

components/polylith/poetry/commands/create_project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from cleo.helpers import option
44
from poetry.console.commands.command import Command
5-
from polylith import project
5+
from polylith import interactive, project
66
from polylith.commands.create import create
77

88
command_name = "poly create project"
@@ -37,6 +37,6 @@ def handle(self) -> int:
3737

3838
create(name, description, create_project)
3939

40-
project.interactive.run(name)
40+
interactive.project.run(name)
4141

4242
return 0

components/polylith/project/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from polylith.project import interactive
21
from polylith.project.create import create_project
32
from polylith.project.get import (
43
get_packages_for_projects,
@@ -14,6 +13,5 @@
1413
"get_project_name",
1514
"get_project_template",
1615
"get_toml",
17-
"interactive",
1816
"parse_package_paths",
1917
]

projects/poetry_polylith_plugin/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ packages = [
2323
{ include = "polylith/files", from = "../../components" },
2424
{ include = "polylith/imports", from = "../../components" },
2525
{ include = "polylith/info", from = "../../components" },
26+
{ include = "polylith/interactive",from = "../../components" },
2627
{ include = "polylith/interface", from = "../../components" },
2728
{ include = "polylith/libs", from = "../../components" },
2829
{ include = "polylith/output", from = "../../components" },

projects/polylith_cli/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ packages = [
2424
{ include = "polylith/files", from = "../../components" },
2525
{ include = "polylith/imports", from = "../../components" },
2626
{ include = "polylith/info", from = "../../components" },
27+
{ include = "polylith/interactive",from = "../../components" },
2728
{ include = "polylith/interface", from = "../../components" },
2829
{ include = "polylith/libs", from = "../../components" },
2930
{ include = "polylith/output", from = "../../components" },

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ packages = [
2727
{ include = "polylith/hatch", from = "components" },
2828
{ include = "polylith/imports", from = "components" },
2929
{ include = "polylith/info", from = "components" },
30+
{ include = "polylith/interactive",from = "components" },
3031
{ include = "polylith/interface", from = "components" },
3132
{ include = "polylith/libs", from = "components" },
3233
{ include = "polylith/output", from = "components" },

0 commit comments

Comments
 (0)