fix pydantic v1 behavior - allow BaseModel
return for ai_fn
#1416
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests | |
env: | |
# enable colored output | |
# https://github.com/pytest-dev/pytest/issues/7443 | |
PY_COLORS: 1 | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- .github/workflows/run-tests.yml | |
- src/** | |
- tests/** | |
- pyproject.toml | |
- setup.py | |
pull_request: | |
paths: | |
- .github/workflows/run-tests.yml | |
- src** | |
- tests/** | |
- pyproject.toml | |
- setup.py | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
run_tests: | |
name: ${{ matrix.test-type }} w/ python ${{ matrix.python-version }} | pydantic ${{ matrix.pydantic_version }} on ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11'] | |
test-type: ['not llm'] | |
llm_model: ['openai/gpt-3.5-turbo'] | |
pydantic_version: ['>=2.4.2'] | |
include: | |
- python-version: '3.9' | |
os: 'ubuntu-latest' | |
test-type: 'llm' | |
llm_model: 'openai/gpt-3.5-turbo' | |
pydantic_version: '>=2.4.2' | |
- python-version: '3.9' | |
os: 'ubuntu-latest' | |
test-type: 'llm' | |
llm_model: 'openai/gpt-3.5-turbo' | |
pydantic_version: '<2' | |
- python-version: '3.9' | |
os: 'ubuntu-latest' | |
test-type: 'not llm' | |
llm_model: 'openai/gpt-3.5-turbo' | |
pydantic_version: '<2' | |
runs-on: ${{ matrix.os }} | |
env: | |
MARVIN_OPENAI_API_KEY: ${{ secrets.MARVIN_OPENAI_API_KEY }} | |
MARVIN_ANTHROPIC_API_KEY: ${{ secrets.MARVIN_ANTHROPIC_API_KEY }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install Marvin | |
run: pip install ".[tests]" | |
- name: Install pydantic v1 | |
run: pip install "pydantic<2" | |
if: ${{ matrix.pydantic_version == '<2' }} | |
- name: Install pydantic v2 | |
run: pip install ".[pydantic-v2]" | |
if: ${{ matrix.pydantic_version == '>=2.4.2' }} | |
- name: Run ${{ matrix.test-type }} tests (${{ matrix.llm_model }}) | |
run: pytest -vv -m "${{ matrix.test-type }}" | |
env: | |
MARVIN_LLM_MODEL: ${{ matrix.llm_model }} | |
if: ${{ !(github.event.pull_request.head.repo.fork && matrix.test-type == 'llm') }} |