Repository navigation
228 lines (207 loc) · 8.11 KB
/
Copy pathci.yml
File metadata and controls
228 lines (207 loc) · 8.11 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: ci
on:
push:
pull_request:
types: [synchronize, reopened, ready_for_review]
jobs:
compile-without-audio:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install
- name: Type check everything except audio utilities
run: poetry run mypy . --exclude 'src/hume/empathic_voice/chat/audio'
compile-with-audio:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install system dependencies for audio
run: |
sudo apt-get --yes update
sudo apt-get --yes install libportaudio2
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install -E microphone
- name: Compile
run: poetry run mypy .
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install system dependencies for audio
run: |
sudo apt-get --yes update
sudo apt-get --yes install libportaudio2
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install -E microphone
- name: Test
run: poetry run pytest -rP .
test-examples:
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' || github.event_name == 'push'
permissions:
contents: read
steps:
- name: Checkout SDK repo (PR branch)
uses: actions/checkout@v4
with:
path: sdk
# checkout the PR branch, not main
ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref }}
fetch-depth: 0
- name: Checkout examples repo
uses: actions/checkout@v4
with:
repository: humeai/hume-api-examples
path: examples
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install system dependencies for audio
run: |
sudo apt-get --yes update
sudo apt-get --yes install libportaudio2
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
shell: bash
- name: Build SDK
working-directory: ./sdk
run: |
echo "=== SDK Build Info ==="
echo "Branch: ${{ github.head_ref || github.ref_name || 'unknown' }}"
echo "Ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref }}"
echo "Commit SHA: $(git rev-parse HEAD)"
echo "Branch name: $(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'detached')"
echo "======================"
poetry install
SDK_VERSION=$(poetry version -s)
echo "SDK version: $SDK_VERSION"
echo "===================="
- name: Link SDK to TTS example
working-directory: ./examples/tts/tts-python-quickstart
run: |
SDK_PATH="${GITHUB_WORKSPACE}/sdk"
SDK_VERSION=$(cd "$SDK_PATH" && poetry version -s)
echo "=== Linking SDK to TTS ==="
echo "SDK version: $SDK_VERSION"
echo "SDK path: $SDK_PATH"
echo "===================="
python -m venv .venv
# Install SDK from local path
# Use -m pip to avoid uv's PEP 621 parsing issues with Poetry projects
.venv/bin/python -m pip install -e "$SDK_PATH"
echo ""
echo "=== Verifying Linked SDK ==="
INSTALLED_VERSION=$(uv run python -c "from importlib.metadata import version; print(version('hume'))")
echo "Installed hume version: $INSTALLED_VERSION"
if [ "$INSTALLED_VERSION" != "$SDK_VERSION" ]; then
echo "✗ WARNING: Version mismatch! Expected $SDK_VERSION, got $INSTALLED_VERSION"
else
echo "✓ Version matches: $INSTALLED_VERSION"
fi
# Verify it's using local SDK (editable install)
SDK_LOCATION=$(uv run python -c "import hume; import os; print(os.path.dirname(hume.__file__))")
echo "SDK location: $SDK_LOCATION"
if [[ "$SDK_LOCATION" == *"$SDK_PATH"* ]]; then
echo "✓ Using local SDK (editable install)"
elif [[ "$SDK_LOCATION" == *"site-packages"* ]]; then
echo "✓ Installed in site-packages (editable install should link to source)"
else
echo "✗ WARNING: May not be using local SDK"
fi
echo "===================="
- name: Run TTS tests
working-directory: ./examples/tts/tts-python-quickstart
run: uv run pytest test_app.py -v
env:
TEST_HUME_API_KEY: ${{ secrets.TEST_HUME_API_KEY }}
- name: Link SDK to EVI example
working-directory: ./examples/evi/evi-python-quickstart
run: |
SDK_PATH="${GITHUB_WORKSPACE}/sdk"
SDK_VERSION=$(cd "$SDK_PATH" && poetry version -s)
echo "=== Linking SDK to EVI ==="
echo "SDK version: $SDK_VERSION"
echo "SDK path: $SDK_PATH"
echo "===================="
python -m venv .venv
# Install SDK from local path
# Use -m pip to avoid uv's PEP 621 parsing issues with Poetry projects
.venv/bin/python -m pip install -e "$SDK_PATH"
echo ""
echo "=== Verifying Linked SDK ==="
INSTALLED_VERSION=$(uv run python -c "from importlib.metadata import version; print(version('hume'))")
echo "Installed hume version: $INSTALLED_VERSION"
if [ "$INSTALLED_VERSION" != "$SDK_VERSION" ]; then
echo "✗ WARNING: Version mismatch! Expected $SDK_VERSION, got $INSTALLED_VERSION"
else
echo "✓ Version matches: $INSTALLED_VERSION"
fi
# Verify it's using local SDK (editable install)
SDK_LOCATION=$(uv run python -c "import hume; import os; print(os.path.dirname(hume.__file__))")
echo "SDK location: $SDK_LOCATION"
if [[ "$SDK_LOCATION" == *"$SDK_PATH"* ]]; then
echo "✓ Using local SDK (editable install)"
elif [[ "$SDK_LOCATION" == *"site-packages"* ]]; then
echo "✓ Installed in site-packages (editable install should link to source)"
else
echo "✗ WARNING: May not be using local SDK"
fi
echo "===================="
- name: Run EVI tests
working-directory: ./examples/evi/evi-python-quickstart
run: uv run pytest test_quickstart.py -v
env:
TEST_HUME_API_KEY: ${{ secrets.TEST_HUME_API_KEY }}
publish:
needs: [compile-without-audio, compile-with-audio, test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
permissions:
id-token: write # required for PyPI trusted publishing (OIDC)
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Build
run: poetry build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1