2828 - name : Install Poetry
2929 uses : snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
3030
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-
3731 - name : Set VERSION
3832 run : |
3933 VERSION=$(echo ${{ matrix.python-version }} | tr -d .)
@@ -43,20 +37,24 @@ jobs:
4337 run : |
4438 echo "MISTRAL_API_KEY=${{ secrets[format('CI_MISTRAL_API_KEY_PYTHON_{0}', env.VERSION)] }}" >> $GITHUB_ENV
4539
46- - name : Run the example scripts
40+ - name : For python 3.9, build and install client. Run examples without extra dependencies.
41+ if : matrix.python-version == '3.9'
4742 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
43+ poetry build
44+ PACKAGE="dist/$(ls dist | grep whl | head -n 1)"
45+ python3 -m pip install "$PACKAGE"
46+ ./examples/run_all.sh --no-extra-dep
47+ env :
48+ MISTRAL_AGENT_ID : ${{ vars.CI_AGENT_ID }}
49+ MISTRAL_API_KEY : ${{ env.MISTRAL_API_KEY }}
50+
51+ - name : For python 3.10+, build and install client with extras. Run all examples.
52+ if : matrix.python-version != '3.9'
53+ run : |
54+ poetry build
55+ PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]"
56+ python3 -m pip install "$PACKAGE"
57+ ./examples/run_all.sh
6058 env :
61- MISTRAL_AGENT_ID : ${{ secrets .CI_AGENT_ID }}
59+ MISTRAL_AGENT_ID : ${{ vars .CI_AGENT_ID }}
6260 MISTRAL_API_KEY : ${{ env.MISTRAL_API_KEY }}
0 commit comments