Skip to content

Commit 572cc39

Browse files
Move from usethis._config import usethis_config imports to the module level in the UI layer
1 parent bb04280 commit 572cc39

13 files changed

Lines changed: 13 additions & 19 deletions

File tree

src/usethis/_ui/interface/author.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import typer
44

5+
from usethis._config import usethis_config
56
from usethis._types.backend import BackendEnum
67
from usethis._ui.options import backend_opt, quiet_opt
78

@@ -15,7 +16,6 @@ def author(
1516
quiet: bool = quiet_opt,
1617
backend: BackendEnum = backend_opt,
1718
) -> None:
18-
from usethis._config import usethis_config
1919
from usethis._config_file import files_manager
2020
from usethis._console import err_print
2121
from usethis._core.author import add_author

src/usethis/_ui/interface/badge.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import typer
66

7+
from usethis._config import usethis_config
78
from usethis._ui.options import offline_opt, quiet_opt
89

910
if TYPE_CHECKING:
@@ -27,7 +28,6 @@ def pypi(
2728
quiet: bool = quiet_opt,
2829
show: bool = show_opt,
2930
) -> None:
30-
from usethis._config import usethis_config
3131
from usethis._config_file import files_manager
3232
from usethis._core.badge import get_pypi_badge
3333

@@ -42,7 +42,6 @@ def ruff(
4242
quiet: bool = quiet_opt,
4343
show: bool = show_opt,
4444
) -> None:
45-
from usethis._config import usethis_config
4645
from usethis._config_file import files_manager
4746
from usethis._core.badge import get_ruff_badge
4847

@@ -57,7 +56,6 @@ def pre_commit(
5756
quiet: bool = quiet_opt,
5857
show: bool = show_opt,
5958
) -> None:
60-
from usethis._config import usethis_config
6159
from usethis._config_file import files_manager
6260
from usethis._core.badge import get_pre_commit_badge
6361

@@ -74,7 +72,6 @@ def socket(
7472
quiet: bool = quiet_opt,
7573
show: bool = show_opt,
7674
) -> None:
77-
from usethis._config import usethis_config
7875
from usethis._config_file import files_manager
7976
from usethis._core.badge import get_socket_badge
8077

@@ -89,7 +86,6 @@ def usethis(
8986
quiet: bool = quiet_opt,
9087
show: bool = show_opt,
9188
) -> None:
92-
from usethis._config import usethis_config
9389
from usethis._config_file import files_manager
9490
from usethis._core.badge import get_usethis_badge
9591

@@ -104,7 +100,6 @@ def uv(
104100
quiet: bool = quiet_opt,
105101
show: bool = show_opt,
106102
) -> None:
107-
from usethis._config import usethis_config
108103
from usethis._config_file import files_manager
109104
from usethis._core.badge import get_uv_badge
110105

src/usethis/_ui/interface/browse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._ui.options import offline_opt, quiet_opt
45

56
app = typer.Typer(
@@ -17,7 +18,6 @@ def pypi(
1718
offline: bool = offline_opt,
1819
quiet: bool = quiet_opt,
1920
) -> None:
20-
from usethis._config import usethis_config
2121
from usethis._console import err_print
2222
from usethis._core.browse import browse_pypi
2323
from usethis.errors import UsethisError

src/usethis/_ui/interface/ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._types.backend import BackendEnum
45
from usethis._ui.options import backend_opt, frozen_opt, offline_opt, quiet_opt
56

@@ -18,7 +19,6 @@ def bitbucket(
1819
frozen: bool = frozen_opt,
1920
backend: BackendEnum = backend_opt,
2021
) -> None:
21-
from usethis._config import usethis_config
2222
from usethis._config_file import files_manager
2323
from usethis._console import err_print
2424
from usethis._core.ci import use_ci_bitbucket

src/usethis/_ui/interface/doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._ui.options import frozen_opt, how_opt, offline_opt, quiet_opt, remove_opt
45

56

@@ -11,7 +12,6 @@ def doc(
1112
frozen: bool = frozen_opt,
1213
) -> None:
1314
"""Add a recommended documentation framework to the project."""
14-
from usethis._config import usethis_config
1515
from usethis._config_file import files_manager
1616
from usethis._console import err_print
1717
from usethis._toolset.doc import use_doc_frameworks

src/usethis/_ui/interface/docstyle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import typer
44

5+
from usethis._config import usethis_config
56
from usethis._types.backend import BackendEnum
67
from usethis._types.docstyle import DocStyleEnum
78
from usethis._ui.options import backend_opt, frozen_opt, offline_opt, quiet_opt
@@ -16,7 +17,6 @@ def docstyle(
1617
frozen: bool = frozen_opt,
1718
backend: BackendEnum = backend_opt,
1819
) -> None:
19-
from usethis._config import usethis_config
2020
from usethis._config_file import files_manager
2121
from usethis._console import err_print
2222
from usethis._core.docstyle import use_docstyle

src/usethis/_ui/interface/format_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._types.backend import BackendEnum
45
from usethis._ui.options import (
56
backend_opt,
@@ -20,7 +21,6 @@ def format_( # noqa: PLR0913
2021
backend: BackendEnum = backend_opt,
2122
) -> None:
2223
"""Add recommended formatters to the project."""
23-
from usethis._config import usethis_config
2424
from usethis._config_file import files_manager
2525
from usethis._console import err_print
2626
from usethis._toolset.format_ import use_formatters

src/usethis/_ui/interface/lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._types.backend import BackendEnum
45
from usethis._ui.options import (
56
backend_opt,
@@ -20,7 +21,6 @@ def lint( # noqa: PLR0913
2021
backend: BackendEnum = backend_opt,
2122
) -> None:
2223
"""Add recommended linters to the project."""
23-
from usethis._config import usethis_config
2424
from usethis._config_file import files_manager
2525
from usethis._console import err_print
2626
from usethis._toolset.lint import use_linters

src/usethis/_ui/interface/rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._types.backend import BackendEnum
45
from usethis._ui.options import backend_opt, offline_opt, quiet_opt
56

@@ -19,7 +20,6 @@ def rule( # noqa: PLR0913
1920
quiet: bool = quiet_opt,
2021
backend: BackendEnum = backend_opt,
2122
) -> None:
22-
from usethis._config import usethis_config
2323
from usethis._config_file import files_manager
2424
from usethis._console import err_print
2525
from usethis._core.rule import (

src/usethis/_ui/interface/show.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typer
22

3+
from usethis._config import usethis_config
34
from usethis._ui.options import offline_opt, quiet_opt
45

56
app = typer.Typer(
@@ -12,7 +13,6 @@ def name(
1213
offline: bool = offline_opt,
1314
quiet: bool = quiet_opt,
1415
) -> None:
15-
from usethis._config import usethis_config
1616
from usethis._config_file import files_manager
1717
from usethis._console import err_print
1818
from usethis._core.show import show_name
@@ -34,7 +34,6 @@ def sonarqube(
3434
offline: bool = offline_opt,
3535
quiet: bool = quiet_opt,
3636
) -> None:
37-
from usethis._config import usethis_config
3837
from usethis._config_file import files_manager
3938
from usethis._console import err_print
4039
from usethis._core.show import show_sonarqube_config

0 commit comments

Comments
 (0)