diff --git a/tests/pydantic-1/poetry.lock b/tests/pydantic-1/poetry.lock index cc13cae..50efa1b 100644 --- a/tests/pydantic-1/poetry.lock +++ b/tests/pydantic-1/poetry.lock @@ -276,24 +276,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "substrate" -version = "120240430.0.0" -description = "Substrate Python SDK" -optional = false -python-versions = ">=3.9" -files = [ - {file = "substrate-120240430.0.0-py3-none-any.whl", hash = "sha256:0addf8bdfab8beaf450a32b31170ffe35c58a0d3d763a5691f4754a9dd6f1a32"}, - {file = "substrate-120240430.0.0.tar.gz", hash = "sha256:b43c5bcef674f7a1ea227e6d0a7deacff09e8b5d8a7bcb784d580b1f80c3ecd8"}, -] - -[package.dependencies] -distro = ">=1.8.0" -httpx = ">=0.26.0" -networkx = ">=3.2.1" -pydantic = ">=1.0.0" -typing-extensions = ">=4.10.0,<5.0.0" - [[package]] name = "tomli" version = "2.0.1" @@ -319,4 +301,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "3a411fdfe92af262af4c3bd4b31ceff0656f488394d64d758a73205c0fe4a5c5" +content-hash = "a9ab545f9c0a6a522ba4c4b26ffa3eb82cd62e574179597e5f5819a3b967f50e" diff --git a/tests/pydantic-1/pyproject.toml b/tests/pydantic-1/pyproject.toml index 3e7b135..9f2d8d8 100644 --- a/tests/pydantic-1/pyproject.toml +++ b/tests/pydantic-1/pyproject.toml @@ -8,7 +8,9 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" pydantic = "<2.0.0" -substrate = "*" +networkx = "^3.3" +httpx = "^0.27.0" +distro = "^1.9.0" [tool.poetry.group.dev.dependencies] pytest = "^8.2.0" diff --git a/tests/pydantic-1/tests/test_basic.py b/tests/pydantic-1/tests/test_basic.py index c455d32..707cbd8 100644 --- a/tests/pydantic-1/tests/test_basic.py +++ b/tests/pydantic-1/tests/test_basic.py @@ -1,8 +1,14 @@ import os +import sys +from pathlib import Path class Test: def test_basic(self): + # add parent dir to sys.path to make 'substrate' importable + parent_dir = Path(__file__).resolve().parent.parent.parent.parent + sys.path.insert(0, str(parent_dir)) + api_key = os.environ.get("SUBSTRATE_API_KEY") if api_key is None: raise EnvironmentError("No SUBSTRATE_API_KEY set") @@ -13,6 +19,9 @@ def test_basic(self): story = GenerateText({"prompt": "tell me a story", "max_tokens": 8}) response = substrate.run(story) + import json + + print("response", json.dumps(response.json, indent=2)) summary_out = response.get(story) assert len(summary_out.text) > 0 diff --git a/tests/pydantic-2/basic.py b/tests/pydantic-2/basic.py deleted file mode 100644 index f6fe2e4..0000000 --- a/tests/pydantic-2/basic.py +++ /dev/null @@ -1,15 +0,0 @@ -import os - -api_key = os.environ.get("SUBSTRATE_API_KEY") -if api_key is None: - raise EnvironmentError("No SUBSTRATE_API_KEY set") - -from substrate import Substrate, GenerateText - -substrate = Substrate(api_key=api_key) - -story = GenerateText({"prompt": "tell me a story", "max_tokens": 8}) -response = substrate.run(story) - -summary_out = response.get(story) -print(summary_out.text) diff --git a/tests/pydantic-2/poetry.lock b/tests/pydantic-2/poetry.lock index 644273d..9c458fd 100644 --- a/tests/pydantic-2/poetry.lock +++ b/tests/pydantic-2/poetry.lock @@ -345,24 +345,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "substrate" -version = "120240430.0.0" -description = "Substrate Python SDK" -optional = false -python-versions = ">=3.9" -files = [ - {file = "substrate-120240430.0.0-py3-none-any.whl", hash = "sha256:0addf8bdfab8beaf450a32b31170ffe35c58a0d3d763a5691f4754a9dd6f1a32"}, - {file = "substrate-120240430.0.0.tar.gz", hash = "sha256:b43c5bcef674f7a1ea227e6d0a7deacff09e8b5d8a7bcb784d580b1f80c3ecd8"}, -] - -[package.dependencies] -distro = ">=1.8.0" -httpx = ">=0.26.0" -networkx = ">=3.2.1" -pydantic = ">=1.0.0" -typing-extensions = ">=4.10.0,<5.0.0" - [[package]] name = "tomli" version = "2.0.1" @@ -388,4 +370,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "6e814ffa5c72f600a907bb0fe766ccd2005a52ec8c792ea9d3b093ad846b7537" +content-hash = "322ba088c1369c015e97221a97c112f1733eb3643422bebba2cd71b3e70c85de" diff --git a/tests/pydantic-2/pyproject.toml b/tests/pydantic-2/pyproject.toml index 5ac71d8..0d4ba45 100644 --- a/tests/pydantic-2/pyproject.toml +++ b/tests/pydantic-2/pyproject.toml @@ -8,7 +8,9 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" pydantic = "^2.0.0" -substrate = "*" +networkx = "^3.3" +httpx = "^0.27.0" +distro = "^1.9.0" [tool.poetry.group.dev.dependencies] pytest = "^8.2.0" diff --git a/tests/pydantic-2/tests/test_basic.py b/tests/pydantic-2/tests/test_basic.py index c455d32..0263096 100644 --- a/tests/pydantic-2/tests/test_basic.py +++ b/tests/pydantic-2/tests/test_basic.py @@ -1,8 +1,14 @@ import os +import sys +from pathlib import Path class Test: def test_basic(self): + # add parent dir to sys.path to make 'substrate' importable + parent_dir = Path(__file__).resolve().parent.parent.parent.parent + sys.path.insert(0, str(parent_dir)) + api_key = os.environ.get("SUBSTRATE_API_KEY") if api_key is None: raise EnvironmentError("No SUBSTRATE_API_KEY set") diff --git a/tests/python-3-9/poetry.lock b/tests/python-3-9/poetry.lock index e69f019..3bc7a9f 100644 --- a/tests/python-3-9/poetry.lock +++ b/tests/python-3-9/poetry.lock @@ -345,24 +345,6 @@ files = [ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, ] -[[package]] -name = "substrate" -version = "120240430.0.0" -description = "Substrate Python SDK" -optional = false -python-versions = ">=3.9" -files = [ - {file = "substrate-120240430.0.0-py3-none-any.whl", hash = "sha256:0addf8bdfab8beaf450a32b31170ffe35c58a0d3d763a5691f4754a9dd6f1a32"}, - {file = "substrate-120240430.0.0.tar.gz", hash = "sha256:b43c5bcef674f7a1ea227e6d0a7deacff09e8b5d8a7bcb784d580b1f80c3ecd8"}, -] - -[package.dependencies] -distro = ">=1.8.0" -httpx = ">=0.26.0" -networkx = ">=3.2.1" -pydantic = ">=1.0.0" -typing-extensions = ">=4.10.0,<5.0.0" - [[package]] name = "tomli" version = "2.0.1" @@ -388,4 +370,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "bdbe814dd88e74ad64a9b2940c8f951e5e2c51e038207ffefc062c4e15aba59b" +content-hash = "1e5f4f054a6ea8602c2343bbb01a62a7b81aefa6baaf1e1907fb35ee6372eb59" diff --git a/tests/python-3-9/pyproject.toml b/tests/python-3-9/pyproject.toml index 37347f8..220f72c 100644 --- a/tests/python-3-9/pyproject.toml +++ b/tests/python-3-9/pyproject.toml @@ -7,7 +7,11 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.9" -substrate = "*" +typing-extensions = "^4.11.0" +pydantic = "^2.7.1" +networkx = "3.2.1" +httpx = "^0.27.0" +distro = "^1.9.0" [tool.poetry.group.dev.dependencies] pytest = "^8.2.0" diff --git a/tests/python-3-9/tests/test_basic.py b/tests/python-3-9/tests/test_basic.py index c455d32..0263096 100644 --- a/tests/python-3-9/tests/test_basic.py +++ b/tests/python-3-9/tests/test_basic.py @@ -1,8 +1,14 @@ import os +import sys +from pathlib import Path class Test: def test_basic(self): + # add parent dir to sys.path to make 'substrate' importable + parent_dir = Path(__file__).resolve().parent.parent.parent.parent + sys.path.insert(0, str(parent_dir)) + api_key = os.environ.get("SUBSTRATE_API_KEY") if api_key is None: raise EnvironmentError("No SUBSTRATE_API_KEY set")