Skip to content

Commit ec4c22f

Browse files
committed
refactor(cli): guard imports with TYPE_CHECKING
1 parent 3fb9e68 commit ec4c22f

5 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎src/autotarcompress/cli/commands/backup.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
"""
66

77
import logging
8+
from typing import TYPE_CHECKING
89

910
from autotarcompress.backup_manager import BackupManager
1011
from autotarcompress.cli.commands.command import Command
11-
from autotarcompress.config import BackupConfig
12+
13+
if TYPE_CHECKING:
14+
from autotarcompress.config import BackupConfig
1215

1316

1417
class BackupCommand(Command):

‎src/autotarcompress/cli/commands/decrypt.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
"""
66

77
import logging
8+
from typing import TYPE_CHECKING
89

910
from autotarcompress.cli.commands.command import Command
10-
from autotarcompress.config import BackupConfig
1111
from autotarcompress.decrypt_manager import DecryptManager
1212

13+
if TYPE_CHECKING:
14+
from autotarcompress.config import BackupConfig
15+
1316

1417
class DecryptCommand(Command):
1518
"""Command to securely decrypt backup archives using OpenSSL with PBKDF2.

‎src/autotarcompress/cli/commands/encrypt.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
"""
1212

1313
import logging
14+
from typing import TYPE_CHECKING
1415

1516
from autotarcompress.cli.commands.command import Command
16-
from autotarcompress.config import BackupConfig
1717
from autotarcompress.encrypt_manager import EncryptManager
1818

19+
if TYPE_CHECKING:
20+
from autotarcompress.config import BackupConfig
21+
1922

2023
class EncryptCommand(Command):
2124
"""Concrete command to perform encryption.

‎src/autotarcompress/cli/commands/extract.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
"""
66

77
import logging
8+
from typing import TYPE_CHECKING
89

910
from autotarcompress.cli.commands.command import Command
10-
from autotarcompress.config import BackupConfig
1111
from autotarcompress.extract_manager import ExtractManager
1212

13+
if TYPE_CHECKING:
14+
from autotarcompress.config import BackupConfig
15+
1316

1417
class ExtractCommand(Command):
1518
"""Command to extract tar.xz and tar.zst backup archives securely."""

‎src/autotarcompress/cli/commands/info.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
"""
66

77
import logging
8+
from typing import TYPE_CHECKING
89

910
from autotarcompress.cli.commands.command import Command
10-
from autotarcompress.config import BackupConfig
1111
from autotarcompress.info_manager import InfoManager
1212

13+
if TYPE_CHECKING:
14+
from autotarcompress.config import BackupConfig
15+
1316

1417
class InfoCommand(Command):
1518
"""Command to display last backup information from backup info file."""

0 commit comments

Comments
 (0)