Skip to content

Commit 57cf30a

Browse files
committed
refact: rename and cleanup
1 parent 8f3ca29 commit 57cf30a

File tree

10 files changed

+10
-114
lines changed

10 files changed

+10
-114
lines changed

packages/hop3-server/src/hop3/core/plugins.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
from devtools import debug
1212
from pluggy import PluginManager
1313

14-
# Temp
15-
from hop3.plugins.build.dummy_build.builder import DummyBuilder
16-
from hop3.plugins.deploy.dummy_deploy.deploy import DummyDeployer
17-
1814
from . import hookspecs
19-
from .hooks import hop3_hook_impl
2015

2116
if TYPE_CHECKING:
2217
from collections.abc import Iterator
@@ -99,10 +94,6 @@ def get_plugin_manager() -> PluginManager:
9994

10095
pm.add_hookspecs(hookspecs)
10196

102-
# Register the core plugin first (provides dummy strategies)
103-
core_plugin = CorePlugin()
104-
pm.register(core_plugin)
105-
10697
# Import all plugin modules and auto-discover plugin instances
10798
#
10899
# Plugin Architecture Notes:
@@ -136,21 +127,6 @@ def get_plugin_manager() -> PluginManager:
136127
return pm
137128

138129

139-
class CorePlugin:
140-
"""The plugin container for Hop3's default strategies."""
141-
142-
name = "core"
143-
144-
@hop3_hook_impl
145-
def get_builders(self) -> list:
146-
# This hook returns classes, not instances.
147-
return [DummyBuilder]
148-
149-
@hop3_hook_impl
150-
def get_deployers(self) -> list:
151-
return [DummyDeployer]
152-
153-
154130
#
155131
# Convenience Helper Functions
156132
#

packages/hop3-server/src/hop3/plugins/build/dummy_build/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/hop3-server/src/hop3/plugins/build/dummy_build/builder.py

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

packages/hop3-server/src/hop3/plugins/build/native_build/__init__.py renamed to packages/hop3-server/src/hop3/plugins/build/language_toolchains/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Copyright (c) 2025, Abilian SAS
22
#
33
# SPDX-License-Identifier: Apache-2.0
4-
"""Native build plugin package.
4+
"""Language toolchains plugin package.
5+
6+
Provides Level 2 toolchains (PythonToolchain, NodeToolchain, etc.)
7+
that are used by LocalBuilder to build applications.
58
69
The plugin instance is exported from plugin.py, not from this __init__.py.
710
This avoids duplicate registration during package discovery, since

packages/hop3-server/src/hop3/plugins/build/native_build/plugin.py renamed to packages/hop3-server/src/hop3/plugins/build/language_toolchains/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from hop3.toolchains import TOOLCHAIN_CLASSES
1010

1111

12-
class NativeBuildPlugin:
12+
class LanguageToolchainsPlugin:
1313
"""Plugin that provides language toolchains for various languages.
1414
1515
This plugin provides Level 2 toolchains (PythonToolchain, NodeToolchain, etc.)
1616
that are used by LocalBuilder to build applications.
1717
"""
1818

19-
name = "native-build"
19+
name = "language-toolchains"
2020

2121
@hop3_hook_impl
2222
def get_language_toolchains(self) -> list:
@@ -29,4 +29,4 @@ def get_language_toolchains(self) -> list:
2929

3030

3131
# Auto-register plugin instance when module is imported
32-
plugin = NativeBuildPlugin()
32+
plugin = LanguageToolchainsPlugin()

packages/hop3-server/src/hop3/plugins/deploy/dummy_deploy/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/hop3-server/src/hop3/plugins/deploy/dummy_deploy/deploy.py

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

packages/hop3-server/tests/a_unit/core/test_build_strategy.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,16 @@ def test_get_builder_with_node_project(tmp_path: Path):
5252
assert builder.context == context
5353

5454

55-
def test_get_builder_no_suitable_builder(tmp_path: Path):
56-
"""Test that get_builder uses DummyBuilder when .dummy-build marker exists."""
57-
# Create source directory without any recognized project files
58-
src_dir = tmp_path / "src"
59-
src_dir.mkdir()
60-
(src_dir / "README.md").write_text("# Test Project\n")
61-
62-
# Create .dummy-build marker file to explicitly request DummyBuilder
63-
# (DummyBuilder only accepts if this marker exists)
64-
(src_dir / ".dummy-build").touch()
65-
66-
# Create DeploymentContext
67-
context = DeploymentContext(app_name="test-app", source_path=src_dir, app_config={})
68-
69-
# With .dummy-build marker, DummyBuilder should accept
70-
builder = get_builder(context)
71-
assert builder.name == "dummy"
72-
73-
7455
def test_get_builder_no_builder_raises_error(tmp_path: Path):
7556
"""Test that get_builder raises RuntimeError when no builder accepts."""
7657
# Create source directory without any recognized project files
77-
# and WITHOUT .dummy-build marker
7858
src_dir = tmp_path / "src"
7959
src_dir.mkdir()
8060
(src_dir / "README.md").write_text("# Test Project\n")
8161

8262
# Create DeploymentContext
8363
context = DeploymentContext(app_name="test-app", source_path=src_dir, app_config={})
8464

85-
# Without any recognized files or .dummy-build marker, should raise RuntimeError
65+
# Without any recognized files, should raise RuntimeError
8666
with pytest.raises(RuntimeError, match="Could not find a suitable builder"):
8767
get_builder(context)

packages/hop3-server/tests/a_unit/deployers/test_deployment_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_uwsgi_deployer_has_app_access(tmp_path: Path):
8080

8181

8282
def test_deployment_strategy_priority(tmp_path: Path):
83-
"""Test that UWSGIDeployer is selected before DummyDeployer."""
83+
"""Test that UWSGIDeployer is selected for various artifact types."""
8484
app = Mock(spec=App)
8585
app.name = "test-app"
8686

packages/hop3-server/tests/b_integration/deployers/test_deployment_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_uwsgi_deployer_has_app_access(self, tmp_path: Path):
109109
assert deployer.app.name == "test-app"
110110

111111
def test_deployment_strategy_priority_for_multiple_artifacts(self, tmp_path: Path):
112-
"""Test that UWSGIDeployer is selected before DummyDeployer.
112+
"""Test that UWSGIDeployer is selected for various artifact types.
113113
114114
ARRANGE:
115115
- Create real App instance

0 commit comments

Comments
 (0)