Repository navigation
72 lines (69 loc) · 2.76 KB
/
Copy pathdeepseek-python-tests.yml
File metadata and controls
72 lines (69 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: DeepSeek Python contracts
on:
pull_request:
branches: [dev, main]
paths:
- 'python/frameworks/deepseek/**'
- 'python/frameworks/openai/**'
- 'python/fi_instrumentation/**'
- '.github/workflows/deepseek-python-tests.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
contract:
name: DeepSeek SDK ${{ matrix.openai }} / core ${{ matrix.core }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- {python: '3.10', openai: '1.0.0', core: source, shared: false}
- {python: '3.10', openai: '1.69.0', core: source, shared: true}
- {python: '3.12', openai: '3.42.1', core: source, shared: true}
- {python: '3.12', openai: '3.42.1', core: wheel, shared: true}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install isolated contract dependencies
env:
SDK_VERSION: ${{ matrix.openai }}
CORE_VERSION: ${{ matrix.core }}
SHARED: ${{ matrix.shared }}
run: |
python -m venv "$RUNNER_TEMP/deepseek-venv"
PYTHON="$RUNNER_TEMP/deepseek-venv/bin/python"
if [ "$CORE_VERSION" = source ]; then
"$PYTHON" -m pip install -e python
else
# Validate the installed candidate required by traceAI-openai;
# the previous published core is now below its dependency floor.
"$PYTHON" -m pip install build
"$PYTHON" -m build --wheel python
"$PYTHON" -m pip install python/dist/*.whl
fi
"$PYTHON" -m pip install -e python/frameworks/deepseek "openai==$SDK_VERSION" 'httpx==0.27.2' pytest pytest-asyncio
if [ "$SHARED" = true ]; then
"$PYTHON" -m pip install -e python/frameworks/openai "openai==$SDK_VERSION"
fi
- name: Run with only loopback networking
env:
SHARED: ${{ matrix.shared }}
FI_BASE_URL: http://127.0.0.1:9
FI_GRPC_URL: http://127.0.0.1:9
run: |
# ubuntu-26.04 sudo ignores -E; pass exactly the variables the tests need.
sudo --preserve-env=RUNNER_TEMP,SHARED,FI_BASE_URL,FI_GRPC_URL unshare --net bash -euo pipefail -c '
ip link set lo up
PYTHON="$RUNNER_TEMP/deepseek-venv/bin/python"
"$PYTHON" -I -m pytest -q --import-mode=importlib python/frameworks/openai/tests/test_deepseek_route.py
"$PYTHON" -I -m pytest -q python/frameworks/deepseek/tests
if [ "$SHARED" = true ]; then
"$PYTHON" -I -m pytest -q python/frameworks/openai/tests
fi
'