Ensure Python 3.8+ compatibility by fixing type annotations and adding CI testing matrix

- Change dict to Dict for Python 3.8 support
- Add Python version matrix (3.8-3.13) to github action test workflow
This commit is contained in:
Samiul Sk 2025-10-11 13:49:31 +05:30
parent 9ddd5f0182
commit b7da7089e4
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -3,14 +3,14 @@ from __future__ import annotations
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