Skip to content

feat: align Azure/GCP SDKs with namespace vision (API-1988)#351

Open
Nelson-PROIA wants to merge 2 commits intomainfrom
nelson.proia/api-1988-sdk-v2-specific-providers-integration
Open

feat: align Azure/GCP SDKs with namespace vision (API-1988)#351
Nelson-PROIA wants to merge 2 commits intomainfrom
nelson.proia/api-1988-sdk-v2-specific-providers-integration

Conversation

@Nelson-PROIA
Copy link
Contributor

@Nelson-PROIA Nelson-PROIA commented Feb 16, 2026

Summary

Migrate Azure/GCP from standalone flat packages (mistralai_azure, mistralai_gcp) into PEP 420 namespace sub-packages within the main mistralai tree, aligned with the existing mistralai.client pattern.

# Before
from mistralai_azure import MistralAzure
from mistralai_gcp import MistralGoogleCloud

# After
from mistralai.azure.client import MistralAzure
from mistralai.gcp.client import MistralGCP

What changed

  • Directory renames: packages/mistralai_azure/packages/azure/, packages/mistralai_gcp/packages/gcp/
  • gen.yaml: set moduleName to mistralai.azure.client / mistralai.gcp.client, bumped version to 2.0.0a4, enabled v2 config flags (see docs/gen-yaml-diff.md for full comparison)
  • Regenerated both SDKs under the new namespace structure via speakeasy run
  • Hatch build config: updated source mappings to merge three mistralai/ trees into one wheel — the generated code now lives at packages/azure/src/mistralai/azure/client/ and packages/gcp/src/mistralai/gcp/client/
  • dev-mode-dirs: required for editable installs (uv sync) — the Azure/GCP code lives in separate source directories (packages/azure/src/, packages/gcp/src/), and hatch needs to be told to put all three dirs on sys.path so that import mistralai.azure.client works at runtime
  • Cross-package consistency fixes: pydantic >=2.11.2, mypy ==1.15.0, package names with hyphens (mistralai-azure, mistralai-gcp), MistralGCPError class naming, .genignore alignment
  • Examples: updated imports and constructor args, removed duplicate example files (az_chat_no_streaming.py, gcp_async_chat_no_streaming.py)
  • Lint script: updated scripts/lint_custom_code.sh paths for new directory structure
  • Parity tests: 157 Azure + 188 GCP parametrized introspection tests covering constructor, context manager, all chat/ocr/fim params, sync/async parity
  • Integration tests: credential-gated tests for Azure chat and GCP chat + FIM (sync/async/streaming/tools/JSON)
  • run_examples.sh: excluded fine-tuning job examples — they fail due to open-mistral-7b no longer being available for fine-tuning (pre-existing issue on main)

Test plan

  • 347 tests pass, 42 skipped (credential-gated integration tests)
  • All linters pass (mypy, pyright, ruff)
  • PEP 420 namespace integrity verified
  • Wheel builds with all three SDK trees merged
  • Editable installs resolve all imports correctly
  • Manual smoke test with Azure credentials
  • Manual smoke test with GCP credentials

@Nelson-PROIA Nelson-PROIA changed the title feat: migrate Azure/GCP SDKs to PEP 420 namespace packages (v2.0.0a1) feat: bundle Azure/GCP SDKs into single mistralai wheel with client subdirectory Feb 16, 2026
@Nelson-PROIA Nelson-PROIA changed the title feat: bundle Azure/GCP SDKs into single mistralai wheel with client subdirectory feat: align Azure/GCP SDKs with namespace vision (API-1988) Feb 16, 2026
@Nelson-PROIA Nelson-PROIA self-assigned this Feb 17, 2026
@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch 5 times, most recently from d1fa5de to 379b180 Compare February 17, 2026 15:37
Copy link
Contributor

@louis-sanna-dev louis-sanna-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nelson-PROIA I think it looks good, not an expert in python packaging to be fair.

Let's also check how to QA with actual Azure/GCP endpoints.

Two nitpicks proposed by Claude:

  • README import path inconsistency
    • README shows: from mistralai.azure import MistralAzure
    • Examples use: from mistralai.azure.client import MistralAzure[4:38 PM]  
  • Duplicate example files
    • examples/azure/az_chat_no_streaming.py and examples/azure/chat_no_streaming.py are identical
    • examples/gcp/async_chat_no_streaming.py and examples/gcp/gcp_async_chat_no_streaming.py are identical

@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch 4 times, most recently from 3879e7f to a424d32 Compare February 20, 2026 10:48
Nelson-PROIA and others added 2 commits February 20, 2026 11:57
- Rename packages/mistralai_azure -> packages/azure,
  packages/mistralai_gcp -> packages/gcp
- Regenerate SDK code with v2 OpenAPI specs under PEP 420
  namespace layout (mistralai.azure.client, mistralai.gcp.client)
- Update build system: root pyproject.toml with dev-mode-dirs,
  wheel sources, bump to v2.0.0a4
- Update .speakeasy/workflow.yaml for new directory structure
- Cross-package consistency fixes: pydantic >=2.11.2,
  mypy ==1.15.0, package name hyphen, MistralGCPError,
  .genignore
- Update examples, migration guide
- Update lint script paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_azure_v2_parity.py: parametrized tests covering constructor,
  context manager, all chat/ocr params, sync/async parity
- test_gcp_v2_parity.py: parametrized tests covering constructor,
  context manager, all chat/fim params, sync/async parity
- test_azure_integration.py: credential-gated integration tests
  for Azure chat (sync/async/streaming/tools/JSON)
- test_gcp_integration.py: credential-gated integration tests
  for GCP chat + FIM (sync/async/streaming/tools)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/api-1988-sdk-v2-specific-providers-integration branch from a424d32 to 075db71 Compare February 20, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments