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
71 changes: 71 additions & 0 deletions .github/workflows/cohere-python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Cohere Python contracts

on:
pull_request:
branches: [main, dev]
paths:
- 'python/frameworks/cohere/**'
- '.github/workflows/cohere-python-tests.yml'
push:
branches: [dev]
paths:
- 'python/frameworks/cohere/**'
- '.github/workflows/cohere-python-tests.yml'

permissions:
contents: read

jobs:
contract:
name: Cohere (${{ matrix.label }})
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- label: SDK and core floors
python: '3.10'
cohere: 'cohere==5.0.0'
core: 'fi-instrumentation-otel==1.2.2'
httpx: 'httpx==0.27.2'
- label: early v2
python: '3.12'
cohere: 'cohere==5.13.12'
core: 'fi-instrumentation-otel==1.2.2'
httpx: 'httpx'
- label: latest SDK and core
python: '3.13'
cohere: 'cohere'
core: 'fi-instrumentation-otel'
httpx: 'httpx'
env:
FI_BASE_URL: http://127.0.0.1:9
FI_GRPC_URL: http://127.0.0.1:9
COHERE_REQUIREMENT: ${{ matrix.cohere }}
CORE_REQUIREMENT: ${{ matrix.core }}
HTTPX_REQUIREMENT: ${{ matrix.httpx }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python }}
- name: Install distribution and compatibility dependencies
shell: bash
run: |
python -m venv .cohere-test-venv
.cohere-test-venv/bin/pip install ./python/frameworks/cohere \
"$COHERE_REQUIREMENT" "$CORE_REQUIREMENT" "$HTTPX_REQUIREMENT" \
pytest pytest-asyncio opentelemetry-exporter-otlp-proto-http
.cohere-test-venv/bin/pip check
- name: Test with only loopback networking
shell: bash
run: |
sudo --preserve-env=FI_BASE_URL,FI_GRPC_URL unshare --net bash -c '
set -e
ip link set lo up
"$1" -I -m pytest python/frameworks/cohere/tests \
--import-mode=importlib -q -p no:cacheprovider
' _ "$PWD/.cohere-test-venv/bin/python"
Loading
Loading