summaryrefslogtreecommitdiff
path: root/Omni/Repl.py
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-02-04 21:18:03 -0500
committerBen Sima <ben@bsima.me>2025-02-04 21:18:03 -0500
commit9f5b334eb6d0f64460f14d76255b096777a46332 (patch)
treedb357ca2a933456e1f35c17a1c85000fb5a64b9d /Omni/Repl.py
parent86ea51353c223cdc82cb8ebd013d58d70a7e646a (diff)
Update ollama, llm-ollama, openai-python, llm
I couldn't use llm-ollama because it required some package upgrades, so I started going down that rabbit hole and ended up 1) realizing that these packages are way out of date now, and 2) fiddling with overrides to get everything to work. I finally figured it out, the `postPatch` in ollama-python was throwing me off for like half a day. Anyway, one thing to note is that these are changing fast and I need to either move onto nixpkgs unstable for python stuff, or maintain my own builds of all of these. Not sure which is more appropriate right now. Oh and I had to fixup some logging stuff in Biz/Storybook.py because ruff started complaining about something, which is weird because I don't think the version changed? But it was easy enough to change.
Diffstat (limited to 'Omni/Repl.py')
-rwxr-xr-xOmni/Repl.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Omni/Repl.py b/Omni/Repl.py
index 8d191e2..d7d2fb4 100755
--- a/Omni/Repl.py
+++ b/Omni/Repl.py
@@ -20,7 +20,6 @@ additional files to load.
import importlib
import importlib.util
import inspect
-import logging
import mypy.api
import Omni.Log as Log
import os
@@ -34,6 +33,8 @@ import types
import typing
import unittest
+LOG = Log.setup()
+
class ReplError(Exception):
"""Type for errors at the repl."""
@@ -48,7 +49,7 @@ def use(ns: str, path: str) -> None:
Raises:
ReplError: if module cannot be loaded
"""
- logging.info("loading %s from %s", ns, path)
+ LOG.info("loading %s from %s", ns, path)
spec = importlib.util.spec_from_file_location(ns, path)
if spec is None or spec.loader is None:
msg = f"spec could not be loaded for {ns} at {path}"
@@ -71,7 +72,7 @@ def typecheck(path: str) -> None:
# this envvar is undocumented, but it works
# https://github.com/python/mypy/issues/13815
os.environ["MYPY_FORCE_COLOR"] = "1"
- logging.info("typechecking %s", path)
+ LOG.info("typechecking %s", path)
stdout, stderr, _ = mypy.api.run([path])
sys.stdout.write(stdout)
sys.stdout.flush()
@@ -89,7 +90,7 @@ def edit_file(ns: str, path: str, editor: str) -> None:
try:
proc = subprocess.run([editor, path], check=False)
except FileNotFoundError:
- logging.exception("editor '%s' not found", editor)
+ LOG.exception("editor '%s' not found", editor)
if proc.returncode == 0:
use(ns, path)
typecheck(path)