mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
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:
parent
9ddd5f0182
commit
b7da7089e4
4
.github/workflows/test.yaml
vendored
4
.github/workflows/test.yaml
vendored
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user