Skip to content

Commit f90538b

Browse files
authoredAug 26, 2024
Python: switch to uv (microsoft#8320)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Switches from poetry to uv much faster and easier lock management easier maintenance of pyproject.toml fixes: microsoft#6584 fixes: microsoft#8326 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent 163d512 commit f90538b

24 files changed

+5819
-8362
lines changed
 

‎.github/workflows/python-build-wheel.yml

-45
This file was deleted.

‎.github/workflows/python-integration-tests.yml

+64-28
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,37 @@ jobs:
4949
matrix:
5050
python-version: ["3.11"]
5151
os: [ubuntu-latest]
52+
env:
53+
# Configure a constant location for the uv cache
54+
UV_CACHE_DIR: /tmp/.uv-cache
5255
steps:
5356
- uses: actions/checkout@v4
54-
- name: Install poetry
55-
run: pipx install poetry
57+
- name: Set up uv
58+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
59+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
60+
- name: Set up uv
61+
if: ${{ matrix.os == 'windows-latest' }}
62+
run: irm https://astral.sh/uv/install.ps1 | iex
63+
shell: powershell
5664
- name: Set up Python ${{ matrix.python-version }}
5765
uses: actions/setup-python@v5
5866
with:
5967
python-version: ${{ matrix.python-version }}
60-
cache: "poetry"
68+
- name: Restore uv cache
69+
id: cache
70+
uses: actions/cache@v4
71+
with:
72+
path: ${{ env.UV_CACHE_DIR }}
73+
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
6174
- name: Install dependencies with hnswlib native disabled
6275
if: matrix.os == 'macos-latest' && matrix.python-version == '3.11'
6376
run: |
6477
export HNSWLIB_NO_NATIVE=1
65-
python -m pip install --upgrade pip setuptools wheel
66-
cd python && poetry install --with tests
78+
uv sync --all-extras --dev
6779
- name: Install dependencies with hnswlib native enabled
6880
if: matrix.os != 'macos-latest' || matrix.python-version != '3.11'
6981
run: |
70-
python -m pip install --upgrade pip setuptools wheel
71-
cd python
72-
poetry install --with tests
82+
uv sync --all-extras --dev
7383
- name: Install Ollama
7484
if: matrix.os == 'ubuntu-latest'
7585
run: |
@@ -98,7 +108,7 @@ jobs:
98108
- name: Run Integration Tests
99109
id: run_tests
100110
shell: bash
101-
env: # Set Azure credentials secret as an input
111+
env:
102112
HNSWLIB_NO_NATIVE: 1
103113
Python_Integration_Tests: Python_Integration_Tests
104114
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME }} # azure-text-embedding-ada-002
@@ -137,7 +147,7 @@ jobs:
137147
REDIS_CONNECTION_STRING: ${{ vars.REDIS_CONNECTION_STRING }}
138148
run: |
139149
cd python
140-
poetry run pytest -n logical --dist loadfile --dist worksteal ./tests/integration ./tests/samples -v --junitxml=pytest.xml
150+
uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration ./tests/samples -v --junitxml=pytest.xml
141151
- name: Surface failing tests
142152
if: always()
143153
uses: pmeier/pytest-results-action@main
@@ -155,6 +165,8 @@ jobs:
155165
fail-on-empty: true
156166
# (Optional) Title of the test results section in the workflow summary
157167
title: Test results
168+
- name: Minimize uv cache
169+
run: uv cache prune --ci
158170

159171
python-integration-tests:
160172
needs: paths-filter
@@ -168,26 +180,32 @@ jobs:
168180
os: [ubuntu-latest, windows-latest, macos-latest]
169181
steps:
170182
- uses: actions/checkout@v4
171-
- name: Install poetry
172-
run: pipx install poetry
183+
- name: Set up uv
184+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
185+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
186+
- name: Set up uv
187+
if: ${{ matrix.os == 'windows-latest' }}
188+
run: irm https://astral.sh/uv/install.ps1 | iex
189+
shell: powershell
173190
- name: Set up Python ${{ matrix.python-version }}
174191
uses: actions/setup-python@v5
175192
with:
176193
python-version: ${{ matrix.python-version }}
177-
cache: "poetry"
194+
- name: Restore uv cache
195+
id: cache
196+
uses: actions/cache@v4
197+
with:
198+
path: ${{ env.UV_CACHE_DIR }}
199+
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
178200
- name: Install dependencies with hnswlib native disabled
179201
if: matrix.os == 'macos-latest' && matrix.python-version == '3.11'
180202
run: |
181203
export HNSWLIB_NO_NATIVE=1
182-
python -m pip install --upgrade pip setuptools wheel
183-
cd python && poetry install --with tests
184-
204+
uv sync --all-extras --dev
185205
- name: Install dependencies with hnswlib native enabled
186206
if: matrix.os != 'macos-latest' || matrix.python-version != '3.11'
187207
run: |
188-
python -m pip install --upgrade pip setuptools wheel
189-
cd python && poetry install --with tests
190-
208+
uv sync --all-extras --dev
191209
- name: Install Ollama
192210
if: matrix.os == 'ubuntu-latest'
193211
run: |
@@ -209,11 +227,15 @@ jobs:
209227

210228
- name: Set up gcloud
211229
uses: google-github-actions/setup-gcloud@v2
230+
231+
- name: Setup Redis Stack Server
232+
if: matrix.os == 'ubuntu-latest'
233+
run: docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
212234

213235
- name: Run Integration Tests
214236
id: run_tests
215237
shell: bash
216-
env: # Set Azure credentials secret as an input
238+
env:
217239
HNSWLIB_NO_NATIVE: 1
218240
Python_Integration_Tests: Python_Integration_Tests
219241
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME }} # azure-text-embedding-ada-002
@@ -240,6 +262,8 @@ jobs:
240262
MISTRALAI_API_KEY: ${{secrets.MISTRALAI_API_KEY}}
241263
MISTRALAI_CHAT_MODEL_ID: ${{ vars.MISTRALAI_CHAT_MODEL_ID }}
242264
MISTRALAI_EMBEDDING_MODEL_ID: ${{ vars.MISTRALAI_EMBEDDING_MODEL_ID }}
265+
ANTHROPIC_API_KEY: ${{secrets.ANTHROPIC_API_KEY}}
266+
ANTHROPIC_CHAT_MODEL_ID: ${{ vars.ANTHROPIC_CHAT_MODEL_ID }}
243267
OLLAMA_MODEL: "${{ matrix.os == 'ubuntu-latest' && vars.OLLAMA_MODEL || '' }}" # phi3
244268
GOOGLE_AI_GEMINI_MODEL_ID: ${{ vars.GOOGLE_AI_GEMINI_MODEL_ID }}
245269
GOOGLE_AI_EMBEDDING_MODEL_ID: ${{ vars.GOOGLE_AI_EMBEDDING_MODEL_ID }}
@@ -248,16 +272,28 @@ jobs:
248272
VERTEX_AI_GEMINI_MODEL_ID: ${{ vars.VERTEX_AI_GEMINI_MODEL_ID }}
249273
VERTEX_AI_EMBEDDING_MODEL_ID: ${{ vars.VERTEX_AI_EMBEDDING_MODEL_ID }}
250274
REDIS_CONNECTION_STRING: ${{ vars.REDIS_CONNECTION_STRING }}
251-
ANTHROPIC_API_KEY: ${{secrets.ANTHROPIC_API_KEY}}
252-
ANTHROPIC_CHAT_MODEL_ID: ${{ vars.ANTHROPIC_CHAT_MODEL_ID }}
253275
run: |
254-
if ${{ matrix.os == 'ubuntu-latest' }}; then
255-
docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
256-
fi
257-
258276
cd python
259-
poetry run pytest -n logical --dist loadfile --dist worksteal ./tests/integration -v
260-
poetry run pytest -n logical --dist loadfile --dist worksteal ./tests/samples -v
277+
uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration ./tests/samples -v --junitxml=pytest.xml
278+
- name: Surface failing tests
279+
if: always()
280+
uses: pmeier/pytest-results-action@main
281+
with:
282+
# A list of JUnit XML files, directories containing the former, and wildcard
283+
# patterns to process.
284+
# See @actions/glob for supported patterns.
285+
path: python/pytest.xml
286+
# (Optional) Add a summary of the results at the top of the report
287+
summary: true
288+
# (Optional) Select which results should be included in the report.
289+
# Follows the same syntax as `pytest -r`
290+
display-options: fEX
291+
# (Optional) Fail the workflow if no JUnit XML was found.
292+
fail-on-empty: true
293+
# (Optional) Title of the test results section in the workflow summary
294+
title: Test results
295+
- name: Minimize uv cache
296+
run: uv cache prune --ci
261297

262298
# This final job is required to satisfy the merge queue. It must only run (or succeed) if no tests failed
263299
python-integration-tests-check:

‎.github/workflows/python-lint.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,29 @@ jobs:
1515
python-version: ["3.10"]
1616
runs-on: ubuntu-latest
1717
continue-on-error: true
18+
defaults:
19+
run:
20+
working-directory: python
21+
env:
22+
# Configure a constant location for the uv cache
23+
UV_CACHE_DIR: /tmp/.uv-cache
1824
steps:
1925
- uses: actions/checkout@v4
20-
- name: Install poetry
21-
run: pipx install poetry
22-
- uses: actions/setup-python@v5
26+
- name: Set up uv
27+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
2330
with:
2431
python-version: ${{ matrix.python-version }}
25-
cache: "poetry"
26-
- name: Install dependencies
27-
run: cd python && poetry install
32+
- name: Restore uv cache
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ env.UV_CACHE_DIR }}
36+
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
37+
- name: Install the project
38+
run: uv sync --all-extras --dev
2839
- uses: pre-commit/action@v3.0.1
40+
with:
41+
extra_args: --config python/.pre-commit-config.yaml
42+
- name: Minimize uv cache
43+
run: uv cache prune --ci

‎.github/workflows/python-unit-tests.yml

+37-14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: ["main", "feature*"]
66
paths:
77
- "python/**"
8+
env:
9+
# Configure a constant location for the uv cache
10+
UV_CACHE_DIR: /tmp/.uv-cache
811

912
jobs:
1013
python-unit-tests:
@@ -28,17 +31,27 @@ jobs:
2831
working-directory: python
2932
steps:
3033
- uses: actions/checkout@v4
31-
- name: Install poetry
32-
run: pipx install poetry
34+
- name: Set up uv
35+
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
36+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
37+
- name: Set up uv
38+
if: ${{ matrix.os == 'windows-latest' }}
39+
run: irm https://astral.sh/uv/install.ps1 | iex
40+
shell: powershell
3341
- name: Set up Python ${{ matrix.python-version }}
3442
uses: actions/setup-python@v5
3543
with:
3644
python-version: ${{ matrix.python-version }}
37-
cache: "poetry"
38-
- name: Install dependencies
39-
run: poetry install --with unit-tests
45+
- name: Restore uv cache
46+
id: cache
47+
uses: actions/cache@v4
48+
with:
49+
path: ${{ env.UV_CACHE_DIR }}
50+
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
51+
- name: Install the project
52+
run: uv sync --all-extras --dev
4053
- name: Test with pytest
41-
run: poetry run pytest --junitxml=pytest.xml ./tests/unit
54+
run: uv run pytest --junitxml=pytest.xml ./tests/unit
4255
- name: Surface failing tests
4356
if: always()
4457
uses: pmeier/pytest-results-action@main
@@ -56,6 +69,8 @@ jobs:
5669
fail-on-empty: true
5770
# (Optional) Title of the test results section in the workflow summary
5871
title: Test results
72+
- name: Minimize uv cache
73+
run: uv cache prune --ci
5974
python-test-coverage:
6075
name: Python Test Coverage
6176
runs-on: [ubuntu-latest]
@@ -65,21 +80,27 @@ jobs:
6580
defaults:
6681
run:
6782
working-directory: python
83+
env:
84+
PYTHON_VERSION: "3.10"
6885
steps:
6986
- uses: actions/checkout@v4
7087
- name: Setup filename variables
7188
run: echo "FILE_ID=${{ github.event.number }}" >> $GITHUB_ENV
72-
- name: Install poetry
73-
run: pipx install poetry
74-
- name: Set up Python 3.10
89+
- name: Set up uv
90+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
91+
- name: Set up Python ${{ env.PYTHON_VERSION }}
7592
uses: actions/setup-python@v5
7693
with:
77-
python-version: "3.10"
78-
cache: "poetry"
79-
- name: Install dependencies
80-
run: poetry install --with unit-tests
94+
python-version: ${{ env.PYTHON_VERSION }}
95+
- name: Restore uv cache
96+
uses: actions/cache@v4
97+
with:
98+
path: ${{ env.UV_CACHE_DIR }}
99+
key: uv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/uv.lock') }}
100+
- name: Install the project
101+
run: uv sync --all-extras --dev
81102
- name: Test with pytest
82-
run: poetry run pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered ./tests/unit | tee python-coverage.txt
103+
run: uv run pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered ./tests/unit | tee python-coverage.txt
83104
- name: Upload coverage
84105
if: always()
85106
uses: actions/upload-artifact@v4
@@ -96,3 +117,5 @@ jobs:
96117
path: python/pytest.xml
97118
overwrite: true
98119
retention-days: 1
120+
- name: Minimize uv cache
121+
run: uv cache prune --ci

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ env/
461461
venv/
462462
myvenv/
463463
ENV/
464+
.venv*/
464465

465466
# Python dist
466467
dist/

‎.vscode/tasks.json

+13-104
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@
88
"label": "setup (contributing-R#)",
99
"detail": "",
1010
"group": "build",
11-
"dependsOn": ["new tool-manifest", "# Setup"],
11+
"dependsOn": [
12+
"new tool-manifest",
13+
"# Setup"
14+
],
1215
"dependsOrder": "sequence"
1316
},
1417
{
1518
"label": "new tool-manifest",
1619
"detail": "Install ReSharper Global Tools",
1720
"command": "dotnet",
1821
"type": "process",
19-
"args": ["new", "tool-manifest"],
22+
"args": [
23+
"new",
24+
"tool-manifest"
25+
],
2026
"options": {
2127
"cwd": "${workspaceFolder}/dotnet"
2228
}
@@ -88,54 +94,6 @@
8894
],
8995
"dependsOrder": "sequence"
9096
},
91-
// *****************************
92-
// Contributing (python) - Setup
93-
// *****************************
94-
{
95-
"label": "setup (contributing-python)",
96-
"detail": "",
97-
"group": "build",
98-
"dependsOn": ["install poetry", "install python packages"],
99-
"dependsOrder": "sequence"
100-
},
101-
{
102-
"label": "install poetry",
103-
"detail": "Install poetry",
104-
"command": "pip3",
105-
"type": "shell",
106-
"args": ["install", "poetry"],
107-
"options": {
108-
"cwd": "${workspaceFolder}/python"
109-
}
110-
},
111-
{
112-
"label": "install python packages",
113-
"detail": "Install python packages",
114-
"command": "poetry",
115-
"type": "shell",
116-
"args": ["install"],
117-
"options": {
118-
"cwd": "${workspaceFolder}/python"
119-
}
120-
},
121-
// Formatting
122-
{
123-
"label": "validate (contributing-python)",
124-
"command": "poetry",
125-
"type": "shell",
126-
"group": "build",
127-
"args": [
128-
"run",
129-
"pre-commit",
130-
"run",
131-
"-c",
132-
".conf/.pre-commit-config.yaml",
133-
"-a"
134-
],
135-
"options": {
136-
"cwd": "${workspaceFolder}/python"
137-
}
138-
},
13997
// ***************
14098
// Kernel (dotnet)
14199
// ***************
@@ -163,7 +121,10 @@
163121
"label": "test (Semantic-Kernel)",
164122
"command": "dotnet",
165123
"type": "process",
166-
"args": ["test", "SemanticKernel.UnitTests.csproj"],
124+
"args": [
125+
"test",
126+
"SemanticKernel.UnitTests.csproj"
127+
],
167128
"problemMatcher": "$msCompile",
168129
"group": "test",
169130
"presentation": {
@@ -271,58 +232,6 @@
271232
}
272233
},
273234
// ****************
274-
// Kernel (python)
275-
// ****************
276-
// Test
277-
{
278-
"label": "test (Semantic-Kernel-Python)",
279-
"command": "poetry",
280-
"type": "shell",
281-
"args": ["run", "pytest", "tests/unit"],
282-
"problemMatcher": "$msCompile",
283-
"group": "test",
284-
"presentation": {
285-
"reveal": "always",
286-
"panel": "shared",
287-
"group": "PR-Validate"
288-
},
289-
"options": {
290-
"cwd": "${workspaceFolder}/python"
291-
}
292-
},
293-
{
294-
"label": "test (Semantic-Kernel-Python Integration)",
295-
"command": "poetry",
296-
"type": "shell",
297-
"args": ["run", "pytest", "tests/integration", "-k", "${input:filter}"],
298-
"problemMatcher": "$msCompile",
299-
"group": "test",
300-
"presentation": {
301-
"reveal": "always",
302-
"panel": "shared",
303-
"group": "PR-Validate"
304-
},
305-
"options": {
306-
"cwd": "${workspaceFolder}/python"
307-
}
308-
},
309-
{
310-
"label": "test (Semantic-Kernel-Python ALL)",
311-
"command": "poetry",
312-
"type": "shell",
313-
"args": ["run", "pytest", "tests", "-k", "${input:filter}"],
314-
"problemMatcher": "$msCompile",
315-
"group": "test",
316-
"presentation": {
317-
"reveal": "always",
318-
"panel": "shared",
319-
"group": "PR-Validate"
320-
},
321-
"options": {
322-
"cwd": "${workspaceFolder}/python"
323-
}
324-
},
325-
// ****************
326235
// Samples (dotnet)
327236
// ****************
328237
// Kernel Syntax Examples
@@ -380,4 +289,4 @@
380289
"description": "Enter a filter to pass as argument or filter"
381290
}
382291
]
383-
}
292+
}

‎python/.conf/packages_list.json

-14
This file was deleted.

‎python/.env.example

+5-25
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,11 @@ AZURE_OPENAI_TEXT_DEPLOYMENT_NAME=""
88
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=""
99
AZURE_OPENAI_ENDPOINT=""
1010
AZURE_OPENAI_API_KEY=""
11-
AZURE_OPENAI_API_VERSION="2024-02-15-preview"
12-
AZURE_OPENAI_TEMPERATURE=0
13-
AZURE_OPENAI_MAX_TOKENS=1000
14-
AZURE_OPENAI_TOP_P=1.0
15-
AZURE_OPENAI_STREAM=true
11+
AZURE_OPENAI_API_VERSION=""
1612
AZURE_AISEARCH_URL=""
1713
AZURE_AISEARCH_SERVICE=""
1814
AZURE_AISEARCH_API_KEY=""
1915
AZURE_AISEARCH_INDEX_NAME=""
20-
AZURE_AISEARCH_EMBEDDING_DEPLOYMENT_NAME=""
21-
AZURE_AISEARCH_USE_SEMANTIC_SEARCH=false
22-
AZURE_AISEARCH_SEMANTIC_SEARCH_CONFIG=default
23-
AZURE_AISEARCH_INDEX_IS_PRECHUNKED=false
24-
AZURE_AISEARCH_TOP_K=5
25-
AZURE_AISEARCH_ENABLE_IN_DOMAIN=true
26-
AZURE_AISEARCH_CONTENT_COLUMNS=content
27-
AZURE_AISEARCH_FILEPATH_COLUMN=filepath
28-
AZURE_AISEARCH_TITLE_COLUMN=title
29-
AZURE_AISEARCH_URL_COLUMN=url
30-
AZURE_AISEARCH_VECTOR_COLUMNS=contentVector
31-
AZURE_AISEARCH_QUERY_TYPE=simple
32-
AZURE_AISEARCH_PERMITTED_GROUPS_COLUMN=
33-
AZURE_AISEARCH_STRICTNESS=3
34-
AZURE_AISEARCH_FILTER=""
3516
MONGODB_ATLAS_CONNECTION_STRING=""
3617
PINECONE_API_KEY=""
3718
PINECONE_ENVIRONMENT=""
@@ -40,11 +21,10 @@ WEAVIATE_URL=""
4021
WEAVIATE_API_KEY=""
4122
GOOGLE_SEARCH_ENGINE_ID=""
4223
REDIS_CONNECTION_STRING=""
43-
AZCOSMOS_API = "" // should be mongo-vcore for now, as CosmosDB only supports vector search in mongo-vcore for now.
44-
AZCOSMOS_CONNSTR = ""
45-
AZCOSMOS_DATABASE_NAME = ""
46-
AZCOSMOS_CONTAINER_NAME = ""
47-
# Starts with AstraCS:
24+
AZCOSMOS_API=""
25+
AZCOSMOS_CONNSTR=""
26+
AZCOSMOS_DATABASE_NAME=""
27+
AZCOSMOS_CONTAINER_NAME=""
4828
ASTRADB_APP_TOKEN=""
4929
ASTRADB_ID=""
5030
ASTRADB_REGION=""

‎.pre-commit-config.yaml ‎python/.pre-commit-config.yaml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
files: ^python/
22
fail_fast: true
33
repos:
4-
- repo: https://github.com/floatingpurr/sync_with_poetry
5-
rev: 1.1.0
6-
hooks:
7-
- id: sync_with_poetry
8-
args: [--config=.pre-commit-config.yaml, --db=python/.conf/packages_list.json, python/poetry.lock]
94
- repo: https://github.com/pre-commit/pre-commit-hooks
105
rev: v4.6.0
116
hooks:
@@ -32,7 +27,7 @@ repos:
3227
name: Check Valid Python Notebooks
3328
types: ["jupyter"]
3429
- repo: https://github.com/asottile/pyupgrade
35-
rev: v3.15.2
30+
rev: v3.17.0
3631
hooks:
3732
- id: pyupgrade
3833
args: [--py310-plus]
@@ -41,12 +36,19 @@ repos:
4136
hooks:
4237
- id: ruff
4338
args: [ --fix, --exit-non-zero-on-fix ]
39+
- id: ruff-format
40+
- repo: https://github.com/astral-sh/uv-pre-commit
41+
# uv version.
42+
rev: 0.3.3
43+
hooks:
44+
# Update the uv lockfile
45+
- id: uv-lock
4446
- repo: local
4547
hooks:
4648
- id: mypy
4749
files: ^python/semantic_kernel/
4850
name: mypy
49-
entry: poetry -C python/ run python -m mypy -p semantic_kernel --config-file=python/mypy.ini
51+
entry: cd python && uv run mypy -p semantic_kernel --config-file mypy.ini
5052
language: system
5153
types: [python]
5254
pass_filenames: false

‎python/.vscode/tasks.json

+23-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "Python: Run Checks",
88
"type": "shell",
9-
"command": "poetry",
9+
"command": "uv",
1010
"args": [
1111
"run",
1212
"pre-commit",
@@ -34,7 +34,7 @@
3434
{
3535
"label": "Python: Run Checks - Staged",
3636
"type": "shell",
37-
"command": "poetry",
37+
"command": "uv",
3838
"args": [
3939
"run",
4040
"pre-commit",
@@ -61,7 +61,7 @@
6161
{
6262
"label": "Python: Run Mypy",
6363
"type": "shell",
64-
"command": "poetry",
64+
"command": "uv",
6565
"args": [
6666
"run",
6767
"pre-commit",
@@ -90,21 +90,17 @@
9090
{
9191
"label": "Python: Install",
9292
"type": "shell",
93-
"command": "poetry",
94-
"args": [
95-
"install",
96-
"--all-extras"
97-
],
93+
"command": "make install PYTHON_VERSION=${input:py_version}",
9894
"presentation": {
99-
"reveal": "silent",
100-
"panel": "shared"
95+
"reveal": "always",
96+
"panel": "new"
10197
},
10298
"problemMatcher": []
10399
},
104100
{
105101
"label": "Python: Tests - Unit",
106102
"type": "shell",
107-
"command": "poetry",
103+
"command": "uv",
108104
"args": [
109105
"run",
110106
"pytest",
@@ -120,7 +116,7 @@
120116
{
121117
"label": "Python: Tests - Unit - Failed Only",
122118
"type": "shell",
123-
"command": "poetry",
119+
"command": "uv",
124120
"args": [
125121
"run",
126122
"pytest",
@@ -138,7 +134,7 @@
138134
{
139135
"label": "Python: Tests - Code Coverage",
140136
"type": "shell",
141-
"command": "poetry run pytest --cov=semantic_kernel --cov-report=term-missing:skip-covered tests/unit/",
137+
"command": "uv run pytest --cov=semantic_kernel --cov-report=term-missing:skip-covered tests/unit/",
142138
"group": "test",
143139
"presentation": {
144140
"reveal": "always",
@@ -149,7 +145,7 @@
149145
{
150146
"label": "Python: Tests - All",
151147
"type": "shell",
152-
"command": "poetry",
148+
"command": "uv",
153149
"args": [
154150
"run",
155151
"pytest",
@@ -168,5 +164,18 @@
168164
},
169165
"problemMatcher": []
170166
}
167+
],
168+
"inputs": [
169+
{
170+
"type": "pickString",
171+
"options": [
172+
"3.10",
173+
"3.11",
174+
"3.12"
175+
],
176+
"id": "py_version",
177+
"description": "Python version",
178+
"default": "3.10"
179+
}
171180
]
172181
}

‎python/DEV_SETUP.md

+93-135
Large diffs are not rendered by default.

‎python/Makefile

+59-43
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,70 @@
1-
SHELL = bash
1+
SHELL = /bin/bash
22

3-
.PHONY: help install recreate-env pre-commit
3+
.PHONY: help install clean
4+
.SILENT:
5+
all: install
46

5-
help:
6-
@echo -e "\033[1mUSAGE:\033[0m"
7-
@echo " make [target]"
8-
@echo ""
9-
@echo -e "\033[1mTARGETS:\033[0m"
10-
@echo " install - install Poetry and project dependencies"
11-
@echo " install-pre-commit - install and configure pre-commit hooks"
12-
@echo " pre-commit - run pre-commit hooks on all files"
13-
@echo " recreate-env - destroy and recreate Poetry's virtualenv"
7+
ifeq ($(PYTHON_VERSION),)
8+
PYTHON_VERSION="3.10"
9+
endif
1410

1511
.ONESHELL:
12+
help:
13+
echo -e "\033[1mUSAGE:\033[0m"
14+
echo " make [target]"
15+
echo ""
16+
echo -e "\033[1mTARGETS:\033[0m"
17+
echo " help - show this help message"
18+
echo " install - install uv, python, Semantic Kernel and all dependencies"
19+
echo " This is the default and will use Python 3.10."
20+
echo " install-uv - install uv"
21+
echo " install-python - install python distributions"
22+
echo " install-sk - install Semantic Kernel and all dependencies"
23+
echo " install-pre-commit - install pre-commit hooks"
24+
echo " clean - remove the virtualenvs"
25+
echo ""
26+
echo -e "\033[1mVARIABLES:\033[0m"
27+
echo " PYTHON_VERSION - Python version to use. Default is 3.10"
28+
echo " By default, 3.10, 3.11 and 3.12 are installed as well."
29+
1630
install:
17-
@# Check to make sure Python is installed
18-
@if ! command -v python3 &> /dev/null
19-
then
20-
echo "Python could not be found"
21-
echo "Please install Python"
22-
exit 1
23-
fi
24-
25-
@# Check if Poetry is installed
26-
@if ! command -v poetry &> /dev/null
27-
then
28-
echo "Poetry could not be found"
29-
echo "Installing Poetry"
30-
curl -sSL https://install.python-poetry.org | python3 -
31-
fi
32-
33-
# Install the dependencies
34-
poetry install
31+
make install-uv
32+
make install-python
33+
make install-sk
34+
make install-pre-commit
35+
36+
UV_VERSION = $(shell uv --version 2> /dev/null)
37+
install-uv:
38+
# Check if uv is installed
39+
ifdef UV_VERSION
40+
echo "uv found $(UV_VERSION)"
41+
echo "running uv update"
42+
uv self update
43+
else
44+
echo "uv could not be found"
45+
echo "Installing uv"
46+
curl -LsSf https://astral.sh/uv/install.sh | sh
47+
endif
3548

3649
.ONESHELL:
37-
recreate-env:
38-
# Stop the current virtualenv if active or alternative use
39-
# `exit` to exit from a Poetry shell session
40-
(deactivate || exit 0)
50+
install-python:
51+
echo "Installing python 3.10, 3.11, 3.12"
52+
uv python install 3.10 3.11 3.12
4153

42-
# Remove all the files of the current environment of the folder we are in
43-
export POETRY_LOCATION=$$(poetry env info -p)
44-
echo "Poetry is $${POETRY_LOCATION}"
45-
rm -rf "$${POETRY_LOCATION}"
54+
.ONESHELL:
55+
install-pre-commit:
56+
echo "Installing pre-commit hooks"
57+
uv run pre-commit install -c python/.pre-commit-config.yaml
4658

47-
pre-commit:
48-
poetry run pre-commit run --all-files -c .conf/.pre-commit-config.yaml
4959

5060
.ONESHELL:
51-
install-pre-commit:
52-
poetry run pre-commit install
53-
# Edit the pre-commit config file to change the config path
54-
sed -i 's|\.pre-commit-config\.yaml|\.conf/\.pre-commit-config\.yaml|g' .git/hooks/pre-commit
61+
install-sk:
62+
echo "Creating and activating venv for python $(PYTHON_VERSION)"
63+
uv venv --python $(PYTHON_VERSION)
64+
echo "Installing Semantic Kernel and all dependencies"
65+
uv sync --all-extras --dev
66+
67+
.ONESHELL:
68+
clean:
69+
# Remove the virtualenv
70+
rm -rf .venv

‎python/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Get Started with Semantic Kernel ⚡
22

33
Install the latest package:
4-
5-
python -m pip install --upgrade semantic-kernel
6-
4+
```bash
5+
python -m pip install --upgrade semantic-kernel
6+
```
77
If you want to use some of the optional dependencies (OpenAI is installed by default), you can install them with:
8-
9-
python -m pip install --upgrade semantic-kernel[hugging_face]
8+
```bash
9+
python -m pip install --upgrade semantic-kernel[hugging_face]
10+
```
1011

1112
or all of them:
12-
13-
python -m pip install --upgrade semantic-kernel[all]
14-
13+
```bash
14+
python -m pip install --upgrade semantic-kernel[all]
15+
```
1516
# AI Services
1617

1718
## OpenAI / Azure OpenAI API keys
@@ -26,7 +27,7 @@ There are two methods to manage keys, secrets, and endpoints:
2627

2728
2. If you'd like to use the `.env` file, you will need to configure the `.env` file with the following keys in the file (see the `.env.example` file):
2829

29-
```
30+
```bash
3031
OPENAI_API_KEY=""
3132
OPENAI_ORG_ID=""
3233
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=""

‎python/log.txt

Whitespace-only changes.

‎python/mypy.ini

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
[mypy]
3-
python_version = 3.11
43
plugins = pydantic.mypy
54
ignore_missing_imports = true
65

‎python/poetry.lock

-7,715
This file was deleted.

‎python/pyproject.toml

+122-191
Original file line numberDiff line numberDiff line change
@@ -1,195 +1,127 @@
1-
[tool.poetry]
1+
[project]
22
name = "semantic-kernel"
3-
version = "1.8.0"
43
description = "Semantic Kernel Python SDK"
5-
authors = ["Microsoft <SK-Support@microsoft.com>"]
4+
authors = [{ name = "Microsoft", email = "SK-Support@microsoft.com"}]
65
readme = "pip/README.md"
76
packages = [{include = "semantic_kernel"}]
8-
homepage = "https://learn.microsoft.com/en-us/semantic-kernel/overview/"
9-
repository = "https://github.com/microsoft/semantic-kernel/"
10-
11-
[tool.poetry.urls]
12-
"Source Code" = "https://github.com/microsoft/semantic-kernel/tree/main/python"
13-
"Release Notes" = "https://github.com/microsoft/semantic-kernel/releases?q=tag%3Apython-1&expanded=true"
14-
15-
[tool.poetry.dependencies]
16-
python = "^3.10,<3.13"
17-
18-
# main dependencies
19-
aiohttp = "^3.8"
20-
pydantic = "^2"
21-
pydantic-settings = "^2"
22-
defusedxml = "^0.7.1"
23-
24-
# embeddings
25-
numpy = [
26-
{ version = ">=1.25", python = "<3.12" },
27-
{ version = ">=1.26", python = ">=3.12" },
7+
requires-python = ">=3.10,<3.13"
8+
urls.homepage = "https://learn.microsoft.com/en-us/semantic-kernel/overview/"
9+
urls.source = "https://github.com/microsoft/semantic-kernel/tree/main/python"
10+
urls.release_notes = "https://github.com/microsoft/semantic-kernel/releases?q=tag%3Apython-1&expanded=true"
11+
urls.issues = "https://github.com/microsoft/semantic-kernel/issues"
12+
# Version read from __version__ field in __init__.py by Flit
13+
dynamic = ["version"]
14+
dependencies = [
15+
"aiohttp ~= 3.8",
16+
"pydantic ~= 2.0",
17+
"pydantic-settings ~= 2.0",
18+
"defusedxml ~= 0.7",
19+
20+
# embeddings
21+
"numpy ~= 1.25.0; python_version < '3.12'",
22+
"numpy ~= 1.26.0; python_version >= '3.12'",
23+
24+
# openai connector
25+
"openai ~= 1.0",
26+
27+
# openapi and swagger
28+
"openapi_core >= 0.18,<0.20",
29+
30+
# OpenTelemetry
31+
"opentelemetry-api ~= 1.24",
32+
"opentelemetry-sdk ~= 1.24",
33+
34+
"prance ~= 23.6.21.0",
35+
36+
# templating
37+
"pybars4 ~= 0.9",
38+
"jinja2 ~= 3.1",
39+
"nest-asyncio ~= 1.6"
2840
]
2941

30-
# openai connector
31-
openai = ">=1.0"
32-
33-
# openapi and swagger
34-
openapi_core = ">=0.18,<0.20"
35-
36-
# OpenTelemetry
37-
opentelemetry-api = "^1.24.0"
38-
opentelemetry-sdk = "^1.24.0"
39-
40-
prance = "^23.6.21.0"
41-
42-
# templating
43-
pybars4 = "^0.9.13"
44-
jinja2 = "^3.1.3"
45-
nest-asyncio = "^1.6.0"
46-
4742
### Optional dependencies
48-
# azure
49-
azure-ai-inference = {version = "^1.0.0b1", allow-prereleases = true, optional = true}
50-
azure-search-documents = {version = "11.6.0b4", allow-prereleases = true, optional = true}
51-
azure-core = { version = "^1.28.0", optional = true}
52-
azure-identity = { version = "^1.13.0", optional = true}
53-
azure-cosmos = { version = "^4.7.0", optional = true}
54-
# chroma
55-
chromadb = { version = ">=0.4.13,<0.6.0", optional = true}
56-
# google
57-
google-cloud-aiplatform = { version = "^1.60.0", optional = true}
58-
google-generativeai = { version = "^0.7.2", optional = true}
59-
# hugging face
60-
transformers = { version = "^4.28.1", extras=['torch'], optional = true}
61-
sentence-transformers = { version = "^2.2.2", optional = true}
62-
torch = {version = "2.2.2", optional = true}
63-
# mongo
64-
motor = { version = "^3.3.2", optional = true }
65-
# notebooks
66-
ipykernel = { version = "^6.21.1", optional = true}
67-
# milvus
68-
pymilvus = { version = ">=2.3,<2.4.6", optional = true}
69-
milvus = { version = ">=2.3,<2.3.8", markers = 'sys_platform != "win32"', optional = true}
70-
# mistralai
71-
mistralai = { version = "^0.4.1", optional = true}
72-
# ollama
73-
ollama = { version = "^0.2.1", optional = true}
74-
# anthropic
75-
anthropic = { version = "^0.32.0", optional = true }
76-
# pinecone
77-
pinecone-client = { version = "^5.0.0", optional = true}
78-
# postgres
79-
psycopg = { version="^3.2.1", extras=["binary","pool"], optional = true}
80-
# qdrant
81-
qdrant-client = { version = '^1.9', optional = true}
82-
# redis
83-
redis = { version = "^5.0.7", extras=['hiredis'], optional = true}
84-
types-redis = { version="^4.6.0.20240425", optional = true }
85-
# usearch
86-
usearch = { version = "^2.9", optional = true}
87-
pyarrow = { version = ">=12.0.1,<18.0.0", optional = true}
88-
weaviate-client = { version = ">=3.18,<5.0", optional = true}
89-
pandas = {version = "^2.2.2", optional = true}
90-
91-
[tool.poetry.group.dev.dependencies]
92-
pre-commit = ">=3.7.1"
93-
ipykernel = "^6.29.4"
94-
nbconvert = "^7.16.4"
95-
pytest = "^8.2.1"
96-
pytest-xdist = { version="^3.6.1", extras=["psutil"]}
97-
pytest-cov = ">=5.0.0"
98-
pytest-asyncio = "^0.23.7"
99-
snoop = "^0.4.3"
100-
mypy = ">=1.10.0"
101-
types-PyYAML = "^6.0.12.20240311"
102-
ruff = ">=0.5.2,<0.7.0"
103-
104-
[tool.poetry.group.unit-tests]
105-
optional = true
106-
107-
[tool.poetry.group.unit-tests.dependencies]
108-
azure-ai-inference = {version = "^1.0.0b1", allow-prereleases = true}
109-
azure-search-documents = {version = "11.6.0b4", allow-prereleases = true}
110-
azure-core = "^1.28.0"
111-
azure-cosmos = "^4.7.0"
112-
mistralai = "^0.4.1"
113-
ollama = "^0.2.1"
114-
google-cloud-aiplatform = "^1.60.0"
115-
anthropic = "^0.32.0"
116-
google-generativeai = "^0.7.2"
117-
transformers = { version = "^4.28.1", extras=['torch']}
118-
sentence-transformers = { version = "^2.2.2"}
119-
torch = {version = "2.2.2"}
120-
# qdrant
121-
qdrant-client = '^1.9'
122-
# redis
123-
redis = { version = "^5.0.7", extras=['hiredis']}
124-
pandas = {version = "^2.2.2"}
125-
126-
[tool.poetry.group.tests]
127-
optional = true
128-
129-
[tool.poetry.group.tests.dependencies]
130-
# azure
131-
azure-ai-inference = {version = "^1.0.0b1", allow-prereleases = true}
132-
azure-search-documents = {version = "11.6.0b4", allow-prereleases = true}
133-
azure-core = "^1.28.0"
134-
azure-identity = "^1.13.0"
135-
azure-cosmos = "^4.7.0"
136-
msgraph-sdk = "^1.2.0"
137-
# chroma
138-
chromadb = ">=0.4.13,<0.6.0"
139-
# google
140-
google-cloud-aiplatform = "^1.60.0"
141-
google-generativeai = "^0.7.2"
142-
# hugging face
143-
transformers = { version = "^4.28.1", extras=['torch']}
144-
sentence-transformers = { version = "^2.2.2"}
145-
torch = {version = "2.2.2"}
146-
# milvus
147-
pymilvus = ">=2.3,<2.4.6"
148-
milvus = { version = ">=2.3,<2.3.8", markers = 'sys_platform != "win32"'}
149-
# mistralai
150-
mistralai = "^0.4.1"
151-
# ollama
152-
ollama = "^0.2.1"
153-
# anthropic
154-
anthropic = "^0.32.0"
155-
# mongodb
156-
motor = "^3.3.2"
157-
# pinecone
158-
pinecone-client = "^5.0.0"
159-
# postgres
160-
psycopg = { version="^3.1.9", extras=["binary","pool"]}
161-
# qdrant
162-
qdrant-client = '^1.9'
163-
# redis
164-
redis = { version="^5.0.7", extras=['hiredis']}
165-
types-redis = { version="^4.6.0.20240425" }
166-
# usearch
167-
usearch = "^2.9"
168-
pyarrow = ">=12.0.1,<18.0.0"
169-
# weaviate
170-
weaviate-client = ">=3.18,<5.0"
171-
pandas = {version = "^2.2.2"}
172-
173-
# Extras are exposed to pip, this allows a user to easily add the right dependencies to their environment
174-
[tool.poetry.extras]
175-
all = ["transformers", "sentence-transformers", "torch", "qdrant-client", "chromadb", "pymilvus", "milvus", "mistralai", "ollama", "anthropic", "google", "weaviate-client", "pinecone-client", "psycopg", "redis", "azure-ai-inference", "azure-search-documents", "azure-core", "azure-identity", "azure-cosmos", "usearch", "pyarrow", "ipykernel", "motor"]
176-
177-
azure = ["azure-ai-inference", "azure-search-documents", "azure-core", "azure-identity", "azure-cosmos", "msgraph-sdk"]
178-
chromadb = ["chromadb"]
179-
google = ["google-cloud-aiplatform", "google-generativeai"]
180-
hugging_face = ["transformers", "sentence-transformers", "torch"]
181-
milvus = ["pymilvus", "milvus"]
182-
mistralai = ["mistralai"]
183-
ollama = ["ollama"]
184-
anthropic = ["anthropic"]
185-
mongo = ["motor"]
186-
notebooks = ["ipykernel"]
187-
pinecone = ["pinecone-client"]
188-
postgres = ["psycopg"]
189-
qdrant = ["qdrant-client"]
190-
redis = ["redis", "types-redis"]
191-
usearch = ["usearch", "pyarrow"]
192-
weaviate = ["weaviate-client"]
43+
[project.optional-dependencies]
44+
azure = [
45+
"azure-ai-inference >= 1.0.0b3",
46+
"azure-search-documents >= 11.6.0b4",
47+
"azure-identity ~= 1.13",
48+
"azure-cosmos ~= 4.7"
49+
]
50+
chroma = [
51+
"chromadb >= 0.4,<0.6"
52+
]
53+
google = [
54+
"google-cloud-aiplatform ~= 1.60",
55+
"google-generativeai ~= 0.7"
56+
]
57+
hugging_face = [
58+
"transformers[torch] ~= 4.28",
59+
"sentence-transformers ~= 2.2",
60+
"torch == 2.2.2"
61+
]
62+
mongo = [
63+
"motor ~= 3.3.2"
64+
]
65+
notebooks = [
66+
"ipykernel ~= 6.29"
67+
]
68+
milvus = [
69+
"pymilvus >= 2.3,<2.4",
70+
"milvus >= 2.3,<2.3.8; platform_system != 'Windows'"
71+
]
72+
mistralai = [
73+
"mistralai ~= 0.4"
74+
]
75+
ollama = [
76+
"ollama ~= 0.2"
77+
]
78+
anthropic = [
79+
"anthropic ~= 0.32"
80+
]
81+
pinecone = [
82+
"pinecone-client ~= 5.0"
83+
]
84+
postgres = [
85+
"psycopg[binary,pool] ~= 3.2"
86+
]
87+
qdrant = [
88+
"qdrant-client ~= 1.9"
89+
]
90+
redis = [
91+
"redis[hiredis] ~= 5.0",
92+
"types-redis ~= 4.6.0.20240425"
93+
]
94+
usearch = [
95+
"usearch ~= 2.9",
96+
"pyarrow >= 12.0,<18.0"
97+
]
98+
weaviate = [
99+
"weaviate-client >= 3.18,<5.0"
100+
]
101+
pandas = [
102+
"pandas ~= 2.2"
103+
]
104+
105+
[tool.uv]
106+
prerelease = "if-necessary-or-explicit"
107+
dev-dependencies = [
108+
"pre-commit ~= 3.7",
109+
"ipykernel ~= 6.29",
110+
"nbconvert ~= 7.16",
111+
"pytest ~= 8.2",
112+
"pytest-xdist[psutil] ~= 3.6",
113+
"pytest-cov >= 5.0",
114+
"pytest-asyncio ~= 0.23",
115+
"snoop ~= 0.4",
116+
"mypy >= 1.10",
117+
"types-PyYAML ~= 6.0.12.20240311",
118+
"ruff ~= 0.5"
119+
]
120+
environments = [
121+
"sys_platform == 'darwin'",
122+
"sys_platform == 'linux'",
123+
"sys_platform == 'win32'"
124+
]
193125

194126
[tool.pytest.ini_options]
195127
addopts = "-ra -q -r fEX"
@@ -198,11 +130,11 @@ addopts = "-ra -q -r fEX"
198130
line-length = 120
199131
target-version = "py310"
200132
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
133+
preview = true
201134

202135
[tool.ruff.lint]
203136
fixable = ["ALL"]
204137
unfixable = []
205-
preview = true
206138
select = [
207139
"D", #pydocstyle checks
208140
"E", #error checks
@@ -227,7 +159,6 @@ ignore = [
227159
]
228160

229161
[tool.ruff.format]
230-
preview = true
231162
docstring-code-format = true
232163

233164
[tool.ruff.lint.pydocstyle]
@@ -246,10 +177,10 @@ notice-rgx = "^# Copyright \\(c\\) Microsoft\\. All rights reserved\\."
246177
min-file-size = 1
247178

248179
[tool.bandit]
249-
targets = ["python/semantic_kernel"]
250-
exclude_dirs = ["python/tests"]
180+
targets = ["semantic_kernel"]
181+
exclude_dirs = ["tests"]
251182

252183
[build-system]
253-
requires = ["poetry-core"]
254-
build-backend = "poetry.core.masonry.api"
184+
requires = ["flit-core >= 3.8"]
185+
build-backend = "flit_core.buildapi"
255186

‎python/samples/concepts/plugins/openapi/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
### Running the OpenAPI syntax example
22

3+
For more generic setup instructions, including how to install the `uv` tool, see the [main README](../../../../DEV_SETUP.md).
4+
35
1. In a terminal, navigate to `semantic_kernel/python/samples/kernel-syntax-examples/openapi_example`.
46

5-
2. Run `poetry install` followed by `poetry shell` to enter poetry's virtual environment.
7+
2. Run `uv sync` followed by `source .venv/bin/activate` to enter the virtual environment (depending on the os, the activate script may be in a different location).
68

79
3. Start the server by running `python openapi_server.py`.
810

‎python/samples/concepts/setup/ALL_SETTINGS.md

+8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ OpenAI | [OpenAIChatCompletion](../../../semantic_kernel/connectors/ai/open_ai/s
1414
| | | ai_model_id | OPENAI_EMBEDDING_MODEL_ID | Yes
1515
| | | api_key | OPENAI_API_KEY | Yes
1616
| | | org_id | OPENAI_ORG_ID | No
17+
| | [OpenAITextToImage](../../../semantic_kernel/connectors/ai/open_ai/services/open_ai_text_to_image.py)
18+
| | | ai_model_id | OPENAI_TEXT_TO_IMAGE_MODEL_ID | Yes
19+
| | | api_key | OPENAI_API_KEY | Yes
20+
| | | org_id | OPENAI_ORG_ID | No
1721
Azure OpenAI | [AzureOpenAIChatCompletion](../../../semantic_kernel/connectors/ai/open_ai/services/azure_chat_completion.py) | | | | [AzureOpenAISettings](../../../semantic_kernel/connectors/ai/open_ai/settings/azure_open_ai_settings.py)
1822
| | | deployment_name | AZURE_OPENAI_CHAT_DEPLOYMENT_NAME | Yes
1923
| | | api_key | AZURE_OPENAI_API_KEY | Yes
@@ -32,6 +36,10 @@ Azure OpenAI | [AzureOpenAIChatCompletion](../../../semantic_kernel/connectors/a
3236
| | | endpoint | AZURE_OPENAI_ENDPOINT | Yes
3337
| | | api_version | AZURE_OPENAI_API_VERSION | Yes
3438
| | | base_url | AZURE_OPENAI_BASE_URL | Yes
39+
| | [AzureTextToImage](../../../semantic_kernel/connectors/ai/open_ai/services/azure_text_to_image.py)
40+
| | | deployment_name | AZURE_OPENAI_TEXT_TO_IMAGE_DEPLOYMENT_NAME | Yes
41+
| | | api_key | AZURE_OPENAI_API_KEY | Yes
42+
| | | endpoint | AZURE_OPENAI_ENDPOINT | Yes
3543

3644
## Memory Service Settings used across SK:
3745

‎python/semantic_kernel/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
from semantic_kernel.kernel import Kernel
44

5-
__all__ = ["Kernel"]
5+
__version__ = "1.8.0"
6+
__all__ = ["Kernel", "__version__"]

‎python/semantic_kernel/contents/utils/data_uri.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if sys.version < "3.11":
1111
from typing_extensions import Self # pragma: no cover
1212
else:
13-
from typing import Self # pragma: no cover
13+
from typing import Self # type: ignore # pragma: no cover
1414

1515
from pydantic import Field, ValidationError, field_validator, model_validator
1616
from pydantic_core import Url

‎python/semantic_kernel/core_plugins/sessions_python_tool/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Please follow the [Azure Container Apps Documentation](https://learn.microsoft.c
66

77
## Configuring the Python Plugin
88

9-
To successfully use the Python Plugin in Semantic Kernel, you must install the Poetry `azure` extras by running `poetry install -E azure`.
9+
To successfully use the Python Plugin in Semantic Kernel, you must install the `azure` extras by running `uv sync --extra azure` or `pip install semantic-kernel[azure]`.
1010

1111
Next, as an environment variable or in the .env file, add the `poolManagementEndpoint` value from above to the variable `ACA_POOL_MANAGEMENT_ENDPOINT`. The `poolManagementEndpoint` should look something like:
1212

‎python/setup_dev.sh

-7
This file was deleted.

‎python/uv.lock

+5,347
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.