From a5b46735d8cc5dd946f3199e65b85c695223ab76 Mon Sep 17 00:00:00 2001 From: Eric Apgar Date: Wed, 18 Mar 2026 18:33:02 -0500 Subject: [PATCH] Updated tests. --- pyproject.toml | 6 ++++-- tests/test_embed.py | 2 +- tests/test_gpt_oss_20b.py | 2 +- tests/test_list_models.py | 4 ++++ tests/test_phi4_multimodal_instruct.py | 2 +- uv.lock | 16 +++++++++------- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8af2b1b..dbdd4f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "llm" # The pip install . -version = "0.4.2" +version = "0.4.3" description = "Library for easy use of LLMs." readme = "README.md" authors = [ @@ -15,7 +15,6 @@ dependencies = [ "torchvision", "sentence-transformers>=5.2.2", "llm-conversation", - "pytest>=8.0", ] [project.optional-dependencies] @@ -38,6 +37,9 @@ all = [ "peft>=0.18.1", "backoff>=2.2.1", ] +dev = [ + "pytest>=8.0", +] [[tool.uv.index]] name = "pytorch-cu130" diff --git a/tests/test_embed.py b/tests/test_embed.py index 3bf34ef..d3c4738 100644 --- a/tests/test_embed.py +++ b/tests/test_embed.py @@ -6,7 +6,7 @@ LLM_MODEL_CACHE inline when invoking pytest so it only exists for that one command and does not persist in your shell: - uv sync --extra openai + uv sync --extra dev LLM_MODEL_CACHE= pytest Tests are skipped automatically if LLM_MODEL_CACHE is not set. diff --git a/tests/test_gpt_oss_20b.py b/tests/test_gpt_oss_20b.py index e5d8e83..e433af9 100644 --- a/tests/test_gpt_oss_20b.py +++ b/tests/test_gpt_oss_20b.py @@ -6,7 +6,7 @@ invoking pytest so it only exists for that one command and does not persist in your shell: - uv sync --extra openai + uv sync --extra dev --extra openai LLM_MODEL_CACHE= pytest Tests are skipped automatically if LLM_MODEL_CACHE is not set. diff --git a/tests/test_list_models.py b/tests/test_list_models.py index 8654e9c..d510f98 100644 --- a/tests/test_list_models.py +++ b/tests/test_list_models.py @@ -1,5 +1,9 @@ """ Tests for llm.list_models. + + uv sync --extra dev + +Make sure the virtual environment is active. """ import pytest diff --git a/tests/test_phi4_multimodal_instruct.py b/tests/test_phi4_multimodal_instruct.py index a532da6..18cc761 100644 --- a/tests/test_phi4_multimodal_instruct.py +++ b/tests/test_phi4_multimodal_instruct.py @@ -6,7 +6,7 @@ invoking pytest so it only exists for that one command and does not persist in your shell: - uv sync --extra microsoft + uv sync --extra dev --extra microsoft LLM_MODEL_CACHE= pytest Tests are skipped automatically if LLM_MODEL_CACHE is not set. diff --git a/uv.lock b/uv.lock index b95a169..6d6c1df 100644 --- a/uv.lock +++ b/uv.lock @@ -192,11 +192,10 @@ wheels = [ [[package]] name = "llm" -version = "0.4.2" +version = "0.4.3" source = { editable = "." } dependencies = [ { name = "llm-conversation" }, - { name = "pytest" }, { name = "sentence-transformers" }, { name = "torch" }, { name = "torchvision", version = "0.24.0", source = { registry = "https://download.pytorch.org/whl/cu130" }, marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" }, @@ -213,6 +212,9 @@ all = [ { name = "peft" }, { name = "triton" }, ] +dev = [ + { name = "pytest" }, +] microsoft = [ { name = "backoff" }, { name = "peft" }, @@ -237,7 +239,7 @@ requires-dist = [ { name = "openai-harmony", marker = "extra == 'openai'", specifier = ">=0.0.8" }, { name = "peft", marker = "extra == 'all'", specifier = ">=0.18.1" }, { name = "peft", marker = "extra == 'microsoft'", specifier = ">=0.18.1" }, - { name = "pytest", specifier = ">=8.0" }, + { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0" }, { name = "sentence-transformers", specifier = ">=5.2.2" }, { name = "torch", index = "https://download.pytorch.org/whl/cu130" }, { name = "torchvision", index = "https://download.pytorch.org/whl/cu130" }, @@ -245,7 +247,7 @@ requires-dist = [ { name = "triton", marker = "extra == 'all'", specifier = ">=3.5.0" }, { name = "triton", marker = "extra == 'openai'", specifier = ">=3.5.0" }, ] -provides-extras = ["openai", "microsoft", "all"] +provides-extras = ["openai", "microsoft", "all", "dev"] [[package]] name = "llm-conversation" @@ -861,7 +863,7 @@ dependencies = [ { name = "torch", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" }, ] wheels = [ - { url = "https://download.pytorch.org/whl/cu130/torchvision-0.24.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:bfca4bfa0f21ee0b67da26fd207be59e54ac6b188076abffd5d1dc5fca8889f2" }, + { url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:bfca4bfa0f21ee0b67da26fd207be59e54ac6b188076abffd5d1dc5fca8889f2" }, ] [[package]] @@ -877,8 +879,8 @@ dependencies = [ { name = "torch", marker = "platform_machine != 'aarch64' or platform_python_implementation != 'CPython' or sys_platform != 'linux'" }, ] wheels = [ - { url = "https://download.pytorch.org/whl/cu130/torchvision-0.24.0%2Bcu130-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:0be70bd2e71fceec225da9436650c7c830ec71a9443071a3a5b66d1b27ebd9df" }, - { url = "https://download.pytorch.org/whl/cu130/torchvision-0.24.0%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:1c1b3aeb3d3a47d8128e75623b5bb719bffe78c50e5ac6256d72bd6771e3b2fe" }, + { url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.0%2Bcu130-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:0be70bd2e71fceec225da9436650c7c830ec71a9443071a3a5b66d1b27ebd9df" }, + { url = "https://download-r2.pytorch.org/whl/cu130/torchvision-0.24.0%2Bcu130-cp312-cp312-win_amd64.whl", hash = "sha256:1c1b3aeb3d3a47d8128e75623b5bb719bffe78c50e5ac6256d72bd6771e3b2fe" }, ] [[package]]