mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-10 12:47:04 +00:00
refactor(cli): import ImageRef from its module instead of the mirror shim
py/unused-import on PR #625 (mirror/model.py:10): the module only re-imported ImageRef from utils.docker.image.discovery. providers.py and the four mirror tests import it from there, as wait/__main__.py already did; no other importer exists. 🎯 Fix: 97 % 💥 Break: 2 % 💸 Cost: – ⏱️ Time: – 🛡️ Security: ~100 % 🏆 Score: 95 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0914910df5
commit
20fae00bdf
6 files changed
+5
-15
No files matched your search
@@ -1,10 +0,0 @@
|
||||
"""Local name for the image reference the mirror commands pass around.
|
||||
|
||||
No ``__all__``: declaring the re-exported name makes autodoc document the
|
||||
class here as well as where it is defined, and sphinx then finds two targets
|
||||
for every ``ImageRef`` annotation.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from utils.docker.image.discovery import ImageRef # noqa: F401
|
||||
@@ -10,7 +10,7 @@ from utils.docker.registry import manifest_digest
|
||||
if TYPE_CHECKING:
|
||||
import argparse
|
||||
|
||||
from .model import ImageRef
|
||||
from utils.docker.image.discovery import ImageRef
|
||||
|
||||
|
||||
class RegistryProvider(ABC):
|
||||
|
||||
@@ -3,8 +3,8 @@ from __future__ import annotations
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from cli.contributing.mirror.model import ImageRef
|
||||
from cli.contributing.mirror.providers import GHCRProvider
|
||||
from utils.docker.image.discovery import ImageRef
|
||||
|
||||
|
||||
class TestGHCRProviderImageBase(unittest.TestCase):
|
||||
|
||||
@@ -5,8 +5,8 @@ import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import cli.contributing.mirror.resolver.__main__ as resolver_main
|
||||
from cli.contributing.mirror.model import ImageRef
|
||||
from utils.cache.yaml import load_yaml_str
|
||||
from utils.docker.image.discovery import ImageRef
|
||||
from utils.roles.mapping import ROLE_FILE_META_SERVICES
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import cli.contributing.mirror.sync.__main__ as sync_main
|
||||
from cli.contributing.mirror.model import ImageRef
|
||||
from utils.docker.image.discovery import ImageRef
|
||||
|
||||
|
||||
class TestMirrorSync(unittest.TestCase):
|
||||
|
||||
@@ -4,7 +4,7 @@ import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import cli.contributing.mirror.wait.__main__ as wait_main
|
||||
from cli.contributing.mirror.model import ImageRef
|
||||
from utils.docker.image.discovery import ImageRef
|
||||
|
||||
|
||||
class TestMirrorWait(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user