Skip to content

Commit 464a467

Browse files
committed
feat: use UV
1 parent ee543e4 commit 464a467

File tree

29 files changed

+3174
-3363
lines changed

29 files changed

+3174
-3363
lines changed

.github/workflows/lint_custom_code.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
with:
2222
python-version: '3.12'
2323

24-
- name: Install Poetry
25-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
2626

2727
- name: Install dependencies
2828
run: |
2929
touch README-PYPI.md
30-
poetry install --all-extras
30+
uv sync --all-extras
3131
3232
# The init, sdkhooks.py and types.py files in the _hooks folders are generated by Speakeasy hence the exclusion
3333
- name: Run all linters

.github/workflows/run_example_scripts.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28-
- name: Install Poetry
29-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
3030

3131
- name: Set VERSION
3232
run: |
@@ -40,13 +40,13 @@ jobs:
4040
- name: Build the package
4141
run: |
4242
touch README-PYPI.md # Create this file since the client is not built by Speakeasy
43-
poetry build
43+
uv build
4444
4545
- name: For python 3.9, install the client and run examples without extra dependencies.
4646
if: matrix.python-version == '3.9'
4747
run: |
4848
PACKAGE="dist/$(ls dist | grep whl | head -n 1)"
49-
python3 -m pip install "$PACKAGE"
49+
uv pip install --system "$PACKAGE"
5050
./scripts/run_examples.sh --no-extra-dep
5151
env:
5252
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}
@@ -56,7 +56,7 @@ jobs:
5656
if: matrix.python-version != '3.9'
5757
run: |
5858
PACKAGE="dist/$(ls dist | grep whl | head -n 1)[agents]"
59-
python3 -m pip install "$PACKAGE"
59+
uv pip install --system "$PACKAGE"
6060
./scripts/run_examples.sh
6161
env:
6262
MISTRAL_AGENT_ID: ${{ secrets.CI_AGENT_ID }}

.github/workflows/test_custom_code.yaml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,11 @@ jobs:
2222
with:
2323
python-version: '3.12'
2424

25-
- name: Install Poetry
26-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
27-
with:
28-
virtualenvs-create: true
29-
virtualenvs-in-project: true
30-
virtualenvs-path: .venv
31-
installer-parallel: true
32-
33-
- name: Load cached venv
34-
id: cached-poetry-dependencies
35-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
36-
with:
37-
path: .venv
38-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
3927

4028
- name: Install dependencies
41-
# Install dependencies if cache does not exist
42-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
43-
run: poetry install --no-interaction --no-root
29+
run: uv sync --all-extras
4430

4531
- name: Run the 'src/mistralai/extra' package unit tests
46-
run: |
47-
source .venv/bin/activate
48-
python3.12 -m unittest discover -s src/mistralai/extra/tests -t src
32+
run: uv run python3.12 -m unittest discover -s src/mistralai/extra/tests -t src

.github/workflows/update_speakeasy.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,13 @@ jobs:
3333
with:
3434
python-version: '3.11'
3535

36-
- name: Install Poetry
37-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
38-
with:
39-
version: latest
40-
virtualenvs-create: true
41-
virtualenvs-in-project: true
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
4238

4339
- name: Install dependencies
4440
run: |
4541
cp README.md README-PYPI.md
46-
poetry install --with dev
42+
uv sync --group dev --no-default-groups
4743
4844
- name: Install Speakeasy CLI
4945
run: |
@@ -70,7 +66,7 @@ jobs:
7066
TARGETS_ARGS="$TARGETS_ARGS --targets $target"
7167
done
7268
73-
poetry run inv update-speakeasy \
69+
uv run inv update-speakeasy \
7470
--version "${{ github.event.inputs.version }}" \
7571
$TARGETS_ARGS
7672
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea
12
**/__pycache__/
23
**/.speakeasy/temp/
34
**/.speakeasy/logs/

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ python:
5656
methodArguments: infer-optional-args
5757
moduleName: ""
5858
outputModelSuffix: output
59-
packageManager: poetry
59+
packageManager: uv
6060
packageName: mistralai
6161
pytestFilterWarnings: []
6262
pytestTimeout: 0

README.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,7 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
5858
>
5959
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.
6060
61-
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.
62-
63-
### uv
64-
65-
*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.
66-
67-
```bash
68-
uv add mistralai
69-
```
61+
The SDK can be installed with either *pip* or *uv* package managers.
7062

7163
### PIP
7264

@@ -76,12 +68,12 @@ uv add mistralai
7668
pip install mistralai
7769
```
7870

79-
### Poetry
71+
### UV
8072

81-
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
73+
*UV* is an extremely fast Python package and project manager. You can use it to add the SDK to your project:
8274

8375
```bash
84-
poetry add mistralai
76+
uv add mistralai
8577
```
8678

8779
### Shell and script usage with `uv`
@@ -347,7 +339,7 @@ asyncio.run(main())
347339

348340
### More examples
349341

350-
You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`.
342+
You can run the examples in the `examples/` directory using `uv run`.
351343

352344

353345
## Providers' SDKs Example Usage
@@ -991,4 +983,4 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
991983
## Contributions
992984

993985
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
994-
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
986+
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.

packages/mistralai_azure/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ PIP
77
pip install mistralai
88
```
99

10-
Poetry
10+
UV
1111
```bash
12-
poetry add mistralai
12+
uv add mistralai
1313
```
1414

1515
**Prerequisites**

0 commit comments

Comments
 (0)