28
28
- name : Install Poetry
29
29
uses : snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
30
30
31
- - name : Build and install client
32
- run : |
33
- touch README-PYPI.md # Create this file since the client is not built from Speakeasy
34
- poetry build
35
- python3 -m pip install dist/mistralai-*.whl
36
-
37
31
- name : Set VERSION
38
32
run : |
39
33
VERSION=$(echo ${{ matrix.python-version }} | tr -d .)
@@ -43,20 +37,27 @@ jobs:
43
37
run : |
44
38
echo "MISTRAL_API_KEY=${{ secrets[format('CI_MISTRAL_API_KEY_PYTHON_{0}', env.VERSION)] }}" >> $GITHUB_ENV
45
39
46
- - name : Run the example scripts
40
+ - name : Build the package
41
+ run : |
42
+ touch README-PYPI.md # Create this file since the client is not built by Speakeasy
43
+ poetry build
44
+
45
+ - name : For python 3.9, install the client and run examples without extra dependencies.
46
+ if : matrix.python-version == '3.9'
47
+ run : |
48
+ PACKAGE="dist/$(ls dist | grep whl | head -n 1)"
49
+ python3 -m pip install "$PACKAGE"
50
+ ./scripts/run_examples.sh --no-extra-dep
51
+ env :
52
+ MISTRAL_AGENT_ID : ${{ secrets.CI_AGENT_ID }}
53
+ MISTRAL_API_KEY : ${{ env.MISTRAL_API_KEY }}
54
+
55
+ - name : For python 3.10+, install client with extras and run all examples.
56
+ if : matrix.python-version != '3.9'
47
57
run : |
48
- failed=0
49
- for file in examples/*.py; do
50
- if [ -f "$file" ] && [ "$file" != "examples/chatbot_with_streaming.py" ]; then
51
- echo "Running $file"
52
- # Do not fail if the script fails, but save it in the failed variable
53
- python3 "$file" > /dev/null || failed=1
54
- fi
55
- done
56
- # If one of the example script failed then exit
57
- if [ $failed -ne 0 ]; then
58
- exit 1
59
- fi
58
+ PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]"
59
+ python3 -m pip install "$PACKAGE"
60
+ ./scripts/run_examples.sh
60
61
env :
61
62
MISTRAL_AGENT_ID : ${{ secrets.CI_AGENT_ID }}
62
63
MISTRAL_API_KEY : ${{ env.MISTRAL_API_KEY }}
0 commit comments