chore: rename bulkgen to hokusai
This commit is contained in:
parent
a28cc97aed
commit
4def49350e
32 changed files with 215 additions and 213 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"""Integration tests for bulkgen.builder."""
|
||||
"""Integration tests for hokusai.builder."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
|
@ -9,17 +9,17 @@ from unittest.mock import patch
|
|||
|
||||
import pytest
|
||||
|
||||
from bulkgen.builder import (
|
||||
from hokusai.builder import (
|
||||
_collect_all_deps, # pyright: ignore[reportPrivateUsage]
|
||||
_collect_dep_files, # pyright: ignore[reportPrivateUsage]
|
||||
_collect_extra_params, # pyright: ignore[reportPrivateUsage]
|
||||
_resolve_prompt, # pyright: ignore[reportPrivateUsage]
|
||||
run_build,
|
||||
)
|
||||
from bulkgen.config import ProjectConfig, TargetConfig
|
||||
from bulkgen.providers import Provider
|
||||
from bulkgen.providers.models import Capability, ModelInfo
|
||||
from bulkgen.state import load_state
|
||||
from hokusai.config import ProjectConfig, TargetConfig
|
||||
from hokusai.providers import Provider
|
||||
from hokusai.providers.models import Capability, ModelInfo
|
||||
from hokusai.state import load_state
|
||||
|
||||
WriteConfig = Callable[[dict[str, object]], ProjectConfig]
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ class TestRunBuild:
|
|||
async def test_build_single_text_target(
|
||||
self, project_dir: Path, simple_text_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result = await run_build(simple_text_config, project_dir, _PROJECT)
|
||||
|
||||
assert result.built == ["output.txt"]
|
||||
|
|
@ -208,7 +208,7 @@ class TestRunBuild:
|
|||
async def test_build_chain_dependency(
|
||||
self, project_dir: Path, multi_target_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result = await run_build(multi_target_config, project_dir, _PROJECT)
|
||||
|
||||
assert "summary.md" in result.built
|
||||
|
|
@ -223,7 +223,7 @@ class TestRunBuild:
|
|||
async def test_incremental_build_skips_clean_targets(
|
||||
self, project_dir: Path, simple_text_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result1 = await run_build(simple_text_config, project_dir, _PROJECT)
|
||||
assert result1.built == ["output.txt"]
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ class TestRunBuild:
|
|||
self, project_dir: Path, write_config: WriteConfig
|
||||
) -> None:
|
||||
config1 = write_config({"targets": {"out.txt": {"prompt": "version 1"}}})
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
r1 = await run_build(config1, project_dir, _PROJECT)
|
||||
assert r1.built == ["out.txt"]
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ class TestRunBuild:
|
|||
config = write_config(
|
||||
{"targets": {"out.md": {"prompt": "x", "inputs": ["data.txt"]}}}
|
||||
)
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
r1 = await run_build(config, project_dir, _PROJECT)
|
||||
assert r1.built == ["out.md"]
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ class TestRunBuild:
|
|||
async def test_selective_build_single_target(
|
||||
self, project_dir: Path, multi_target_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result = await run_build(
|
||||
multi_target_config, project_dir, _PROJECT, target="summary.md"
|
||||
)
|
||||
|
|
@ -273,7 +273,7 @@ class TestRunBuild:
|
|||
async def test_selective_build_unknown_target_raises(
|
||||
self, project_dir: Path, simple_text_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
with pytest.raises(ValueError, match="Unknown target"):
|
||||
_ = await run_build(
|
||||
simple_text_config, project_dir, _PROJECT, target="nonexistent.txt"
|
||||
|
|
@ -321,7 +321,7 @@ class TestRunBuild:
|
|||
routing_provider.generate = selective_generate # type: ignore[assignment]
|
||||
|
||||
with patch(
|
||||
"bulkgen.builder._create_providers",
|
||||
"hokusai.builder._create_providers",
|
||||
return_value=[routing_provider, FakeImageProvider()],
|
||||
):
|
||||
result = await run_build(config, project_dir, _PROJECT)
|
||||
|
|
@ -342,7 +342,7 @@ class TestRunBuild:
|
|||
)
|
||||
|
||||
with patch(
|
||||
"bulkgen.builder._create_providers",
|
||||
"hokusai.builder._create_providers",
|
||||
return_value=[FailingTextProvider(), FakeImageProvider()],
|
||||
):
|
||||
result = await run_build(config, project_dir, _PROJECT)
|
||||
|
|
@ -355,7 +355,7 @@ class TestRunBuild:
|
|||
self, project_dir: Path, simple_text_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch(
|
||||
"bulkgen.builder._create_providers",
|
||||
"hokusai.builder._create_providers",
|
||||
return_value=[],
|
||||
):
|
||||
result = await run_build(simple_text_config, project_dir, _PROJECT)
|
||||
|
|
@ -374,7 +374,7 @@ class TestRunBuild:
|
|||
}
|
||||
}
|
||||
)
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
_ = await run_build(config, project_dir, _PROJECT)
|
||||
|
||||
state = load_state(project_dir, _PROJECT)
|
||||
|
|
@ -386,7 +386,7 @@ class TestRunBuild:
|
|||
) -> None:
|
||||
config = write_config({"targets": {"out.txt": {"prompt": prompt_file.name}}})
|
||||
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result = await run_build(config, project_dir, _PROJECT)
|
||||
|
||||
assert result.built == ["out.txt"]
|
||||
|
|
@ -396,7 +396,7 @@ class TestRunBuild:
|
|||
async def test_rebuild_after_output_deleted(
|
||||
self, project_dir: Path, simple_text_config: ProjectConfig
|
||||
) -> None:
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
r1 = await run_build(simple_text_config, project_dir, _PROJECT)
|
||||
assert r1.built == ["output.txt"]
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ class TestRunBuild:
|
|||
}
|
||||
}
|
||||
)
|
||||
with patch("bulkgen.builder._create_providers", return_value=_fake_providers()):
|
||||
with patch("hokusai.builder._create_providers", return_value=_fake_providers()):
|
||||
result = await run_build(config, project_dir, _PROJECT)
|
||||
|
||||
assert set(result.built) == {"left.md", "right.md", "merge.txt"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue