diff --git a/.github/workflows/sdk_generation_mistralai_sdk.yaml b/.github/workflows/sdk_generation_mistralai_sdk.yaml index 50845a3a..ba544b49 100644 --- a/.github/workflows/sdk_generation_mistralai_sdk.yaml +++ b/.github/workflows/sdk_generation_mistralai_sdk.yaml @@ -117,23 +117,39 @@ jobs: CURRENT=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') if [ "$CURRENT" = "$VERSION" ]; then - echo "Version already aligned to $VERSION" - exit 0 + echo "pyproject.toml already aligned to $VERSION" + else + echo "Updating version from $CURRENT to $VERSION" + uv version "$VERSION" fi - echo "Updating version from $CURRENT to $VERSION" - uv version "$VERSION" + VERSION="$VERSION" python - <<'PY' + import os + import re + from pathlib import Path + + version = os.environ["VERSION"] + path = Path("src/mistralai/client/_version.py") + text = path.read_text() + text = re.sub(r'__version__: str = "[^"]+"', f'__version__: str = "{version}"', text) + text = re.sub( + r'__user_agent__: str = "speakeasy-sdk/python [^ ]+ ', + f'__user_agent__: str = "speakeasy-sdk/python {version} ', + text, + ) + path.write_text(text) + PY - name: Commit and push if: steps.branch-exists.outputs.exists == 'true' run: | git config user.email "action@github.com" git config user.name "GitHub Action" - git add pyproject.toml uv.lock + git add pyproject.toml uv.lock src/mistralai/client/_version.py if git diff --cached --quiet; then echo "No changes to commit" else VERSION=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') - git commit -m "chore: align pyproject.toml and uv.lock to version $VERSION" + git commit -m "chore: align package version files to version $VERSION" git push fi diff --git a/src/mistralai/client/_version.py b/src/mistralai/client/_version.py index 55510e30..57656b1f 100644 --- a/src/mistralai/client/_version.py +++ b/src/mistralai/client/_version.py @@ -4,10 +4,10 @@ import importlib.metadata __title__: str = "mistralai" -__version__: str = "2.5.0" +__version__: str = "2.5.1" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.884.13" -__user_agent__: str = "speakeasy-sdk/python 2.5.0 2.884.13 1.0.0 mistralai" +__user_agent__: str = "speakeasy-sdk/python 2.5.1 2.884.13 1.0.0 mistralai" try: if __package__ is not None: