refactor: switch to basedpyright, remove pydantic-settings

- Replace pyright with basedpyright in devenv.nix (custom hook)
- Add basedpyright to devenv packages
- Fix all basedpyright warnings: add DiGraph[str] type args, annotate
  class attributes, narrow SyncResponse, handle unused call results,
  suppress unavoidable Any from yaml.safe_load and untyped blackforest
- Replace pydantic-settings[yaml] with direct pyyaml dependency
- Update CLAUDE.md to reflect basedpyright and dependency changes
This commit is contained in:
Konstantin Fickel 2026-02-13 20:25:28 +01:00
parent f71af1cfaf
commit 7ab25d49cb
Signed by: kfickel
GPG key ID: A793722F9933C1A5
11 changed files with 58 additions and 59 deletions

View file

@ -14,6 +14,8 @@ from bulkgen.providers import Provider
class TextProvider(Provider):
"""Generates text via the Mistral API."""
_api_key: str
def __init__(self, api_key: str) -> None:
self._api_key = api_key
@ -50,8 +52,8 @@ class TextProvider(Provider):
messages=[models.UserMessage(content=full_prompt)],
)
if response is None or not response.choices:
msg = f"Mistral API returned no response for target '{target_name}'"
if not response.choices:
msg = f"Mistral API returned no choices for target '{target_name}'"
raise RuntimeError(msg)
content = response.choices[0].message.content
@ -60,4 +62,4 @@ class TextProvider(Provider):
raise RuntimeError(msg)
text = content if isinstance(content, str) else str(content)
output_path.write_text(text)
_ = output_path.write_text(text)