Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Removes hamilton dependency

elijahbenizzyfc9c68b3aec7
diff --git a/burr/integrations/hamilton.py b/burr/integrations/hamilton.py
index f9b8bfdd..4a733e9f 100644
--- a/burr/integrations/hamilton.py
+++ b/burr/integrations/hamilton.py
@@ -1,7 +1,16 @@
import dataclasses
from typing import Any, Dict, Literal, Tuple, Union
-from hamilton.driver import Driver
+from burr.integrations.base import require_plugin
+
+try:
+ from hamilton.driver import Driver
+except ImportError as e:
+ require_plugin(
+ e,
+ ["sf-hamilton"],
+ "hamilton",
+ )
from burr.core import Action, State
diff --git a/examples/gpt/requirements.txt b/examples/gpt/requirements.txt
index d75c4699..61560bab 100644
--- a/examples/gpt/requirements.txt
+++ b/examples/gpt/requirements.txt
@@ -1,2 +1,3 @@
+burr[hamilton]
burr[streamlit]
openai
diff --git a/pyproject.toml b/pyproject.toml
index e73f8bcf..e65629f4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,9 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "burr"
version = "0.9.0"
-dependencies = [
- "sf-hamilton>=1.47.0"
-]
+dependencies = [] # yes, there are none
requires-python = ">=3.9"
authors = [
{name = "Elijah ben Izzy", email = "[email protected]"},
@@ -30,7 +28,12 @@ classifiers = [
streamlit = [
"streamlit",
"graphviz",
- "matplotlib"
+ "matplotlib",
+ "sf-hamilton"
+]
+
+hamilton = [
+ "sf-hamilton"
]
graphviz = [
@@ -44,6 +47,7 @@ postgresql = [
tests = [
"pytest",
"pytest-asyncio",
+ "burr[hamilton]"
]
documentation = [
@@ -79,7 +83,7 @@ tracking = [
]
learn = [
- "burr[tracking,streamlit,graphviz]"
+ "burr[tracking,streamlit,graphviz,hamilton]"
]
start = [