Skip to content

PEP 420 namespace support, widen otel upper bound#346

Merged
Nelson-PROIA merged 1 commit intomainfrom
nelson.proia/sdk-v2-workflows-integration
Feb 13, 2026
Merged

PEP 420 namespace support, widen otel upper bound#346
Nelson-PROIA merged 1 commit intomainfrom
nelson.proia/sdk-v2-workflows-integration

Conversation

@Nelson-PROIA
Copy link
Contributor

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

Summary

Validation

Built wheels from both repos and verified the PEP 420 namespace merge in a clean venv using the following script:

#!/usr/bin/env bash
set -euo pipefail

CLIENT_WHL="${1:?Usage: $0 <client.whl> <workflows.whl>}"
WORKFLOWS_WHL="${2:?Usage: $0 <client.whl> <workflows.whl>}"
VENV="/tmp/test-pep420-ns"
PYTHON="${PYTHON:-python3.12}"

cleanup() { rm -rf "$VENV"; }
trap cleanup EXIT

echo "=== Creating clean venv ($PYTHON) ==="
"$PYTHON" -m venv "$VENV"
source "$VENV/bin/activate"

echo ""
echo "=== Test 1: Client only ==="
pip install --quiet "$CLIENT_WHL"
python -c "from mistralai.client import Mistral; print('  client import: OK')"
python -c "
try:
    from mistralai.workflows import workflow
    print('  FAIL: workflows should not be importable')
    exit(1)
except ImportError:
    print('  workflows not importable (expected): OK')
"

echo ""
echo "=== Test 2: No __init__.py at namespace level ==="
python -c "
import pathlib, sysconfig
ns = pathlib.Path(sysconfig.get_path('purelib')) / 'mistralai' / '__init__.py'
if ns.exists():
    print('  FAIL: mistralai/__init__.py exists (breaks PEP 420)')
    exit(1)
else:
    print('  no mistralai/__init__.py: OK')
"

echo ""
echo "=== Test 3: Client + workflows ==="
pip install --quiet "$WORKFLOWS_WHL"
python -c "from mistralai.client import Mistral; print('  client import: OK')"
python -c "from mistralai.workflows import workflow; print('  workflows import: OK')"

echo ""
echo "=== Test 4: Namespace directory listing ==="
python -c "
import pathlib, sysconfig
ns = pathlib.Path(sysconfig.get_path('purelib')) / 'mistralai'
for p in sorted(ns.iterdir()):
    print(f'  {p.name}/')
"

echo ""
echo "=== All tests passed ==="

Known issue: CI examples failing

The run_example_scripts CI job fails on fine-tuning examples (async_jobs.py, jobs.py, dry_run_job.py) because no models are available for completion fine-tuning on the CI API key. This is a pre-existing issue unrelated to this PR.

Builds on #340.

@Nelson-PROIA Nelson-PROIA changed the title feat: add workflows namespace sub-package extras feat!: add workflows namespace sub-package extras Feb 11, 2026
@Nelson-PROIA
Copy link
Contributor Author

CI fails because uv sync --all-extras resolves mistralai-workflows>=2.0.0 from PyPI. Published versions (<=2.0.0b3) pin opentelemetry-semantic-conventions<=0.58b0, conflicting with this repo's >=0.59b0,<0.60. Unblocked once the updated mistralai-workflows with compatible otel deps is published.

@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/sdk-v2-workflows-integration branch from 2500f70 to 9a71b31 Compare February 11, 2026 09:33
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.

Very nice.

I'm blocking the merge since we need before merging:

  • to update the workflow package to respect the target structure mistralai/workflows
  • to solve those otel issues

@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/sdk-v2-workflows-integration branch from 7bd332a to 02bffb1 Compare February 11, 2026 13:54
README.md Outdated

```bash
pip install mistralai[gcp]
uv add "mistralai[gcp]"
Copy link
Contributor

Choose a reason for hiding this comment

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

@Nelson-PROIA apologies for contradictory review, but I think we should use pip in doc (😶‍🌫️) (like other big SDK do).

@HHK1
Copy link

HHK1 commented Feb 12, 2026

@louis-sanna-dev

to update the workflow package to respect the target structure mistralai/workflows

Actually I don't think we should do this in this order. The main SDK (on which the workflow SDK depends) should first be updated no? Then, the workflow SDK can be updated and published with a new major version?

@louis-sanna-dev
Copy link
Contributor

louis-sanna-dev commented Feb 12, 2026

@louis-sanna-dev

to update the workflow package to respect the target structure mistralai/workflows

Actually I don't think we should do this in this order. The main SDK (on which the workflow SDK depends) should first be updated no? Then, the workflow SDK can be updated and published with a new major version?

@HHK1 yes your are correct.

I was incorrectly understanding how the whole the workflow SDK fitted with the rest.

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 looks good, let's just move back to pip in doc and merge.

@Nelson-PROIA Nelson-PROIA changed the title feat!: add workflows namespace sub-package extras PEP 420 namespace support, widen otel bound, fix fine-tuning examples Feb 13, 2026
- Widen opentelemetry-semantic-conventions upper bound from <0.60 to <0.61
- Add "Additional packages" section to README for mistralai-* namespace packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nelson-PROIA Nelson-PROIA force-pushed the nelson.proia/sdk-v2-workflows-integration branch from be055f3 to 5fb625c Compare February 13, 2026 09:22
@Nelson-PROIA Nelson-PROIA changed the title PEP 420 namespace support, widen otel bound, fix fine-tuning examples PEP 420 namespace support, widen otel upper bound Feb 13, 2026
@Nelson-PROIA Nelson-PROIA merged commit 346dc75 into main Feb 13, 2026
5 of 13 checks passed
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.

[BUG CLIENT]: opentelemetry-semantic-conventions upper bound <0.60 blocks compatibility with opentelemetry-api>=1.39.0

3 participants