Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uvx hatch test -acp
if: ${{ always() }}
lint:
Expand Down
4 changes: 2 additions & 2 deletions ollama/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import inspect
import re
from collections import defaultdict
from typing import Callable, Union
from typing import Callable, Dict, Union

import pydantic

from ollama._types import Tool


def _parse_docstring(doc_string: Union[str, None]) -> dict[str, str]:
def _parse_docstring(doc_string: Union[str, None]) -> Dict[str, str]:
parsed_docstring = defaultdict(str)
if not doc_string:
return parsed_docstring
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ default-args = ['ollama', 'tests']
extra-dependencies = [
'pytest-anyio',
'pytest-httpserver',
'tox',
]

[tool.hatch.envs.hatch-static-analysis]
Expand Down
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Tox configuration for local multi-version testing
# Run `tox` to test the package on all supported Python versions
# Requires Python interpreters to be installed (e.g., via pyenv)

[tox]
envlist = py38, py39, py310, py311, py312, py313
skip_missing_interpreters = true

[testenv]
allowlist_externals = uv
deps =
pytest
pytest-anyio
pytest-httpserver
install_command = uv pip install {opts} {packages}
commands = uv run pytest {posargs:tests/}