Replace dynamicprompts.WildcardManager with a native implementation in src/wildcards.py that loads .txt, .yaml, and .json wildcard files from one or more directories using fnmatch pattern matching. EvaluationContext now types wildcard_manager as a WildcardProvider Protocol rather than the concrete class. Remove dynamicprompts from dependencies; add pyyaml>=6.0 and types-pyyaml as its replacement. Add explicit_package_bases = true to mypy config to resolve duplicate module path ambiguity from the root __init__.py. Update README and CLAUDE to reflect the native parser architecture and removal of the Jinja2 node. Remove completed plan documents. Ignore user-specific yaml wildcard files via .gitignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
583 B
Python
18 lines
583 B
Python
import pytest
|
|
from pathlib import Path
|
|
|
|
import src.wildcards as wildcards_mod
|
|
from src.wildcards import WildcardManager
|
|
|
|
|
|
@pytest.fixture
|
|
def wildcards_path(tmp_path: Path) -> Path:
|
|
(tmp_path / "animals.txt").write_text("cat\ndog\nbird\n")
|
|
(tmp_path / "styles.yaml").write_text("painting:\n - oil painting\n - watercolor\n")
|
|
return tmp_path
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def patch_wildcards(wildcards_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
monkeypatch.setattr(wildcards_mod, "get_wildcard_manager", lambda: WildcardManager(paths=[wildcards_path]))
|