Skip to content

Commit 7c28c70

Browse files
Copilotjgbradley1AlonsoGuevara
authored
Switch from Poetry to uv for package management (#2008)
* Initial plan * Switch from Poetry to uv for package management Co-authored-by: jgbradley1 <[email protected]> * Clean up build artifacts and update gitignore Co-authored-by: jgbradley1 <[email protected]> * remove build artifacts * remove hardcoded version string * fix calls to pip in cicd * Update gh-pages.yml workflow to use uv instead of Poetry Co-authored-by: jgbradley1 <[email protected]> * ruff formatting fixes * update cicd workflow with latest uv action * fix command to retrieve package version * update development instructions * remove Poetry references * Replace deprecated azuright action with npm-based Azurite installation Co-authored-by: jgbradley1 <[email protected]> * skip api version check for azurite * add semversioner file * update more changes from switching to UV * Migrate unified-search-app from Poetry to uv package management Co-authored-by: jgbradley1 <[email protected]> * minor typo update * minor Dockerfile update * update cicd thresholds * update pytest thresholds * ruff fixes * ruff fixes * remove legacy npm settings that no longer apply * Update Unified Search App Readme --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jgbradley1 <[email protected]> Co-authored-by: Josh Bradley <[email protected]> Co-authored-by: Alonso Guevara <[email protected]>
1 parent 5713205 commit 7c28c70

File tree

28 files changed

+7407
-11270
lines changed

28 files changed

+7407
-11270
lines changed

.github/workflows/gh-pages.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ permissions:
66
contents: write
77

88
env:
9-
POETRY_VERSION: '1.8.3'
10-
PYTHON_VERSION: '3.11'
9+
PYTHON_VERSION: "3.11"
1110

1211
jobs:
1312
build:
@@ -29,18 +28,16 @@ jobs:
2928
with:
3029
python-version: ${{ env.PYTHON_VERSION }}
3130

32-
- name: Install Poetry ${{ env.POETRY_VERSION }}
33-
uses: abatilo/[email protected]
34-
with:
35-
poetry-version: ${{ env.POETRY_VERSION }}
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v6
3633

37-
- name: poetry intsall
34+
- name: Install dependencies
3835
shell: bash
39-
run: poetry install
36+
run: uv sync --extra dev
4037

4138
- name: mkdocs build
4239
shell: bash
43-
run: poetry run poe build_docs
40+
run: uv run poe build_docs
4441

4542
- name: List Docsite Contents
4643
run: find site

.github/workflows/python-ci.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ concurrency:
2626
# Only run the for the latest commit
2727
cancel-in-progress: true
2828

29-
env:
30-
POETRY_VERSION: 1.8.3
31-
3229
jobs:
3330
python-ci:
3431
# skip draft PRs
@@ -51,7 +48,7 @@ jobs:
5148
filters: |
5249
python:
5350
- 'graphrag/**/*'
54-
- 'poetry.lock'
51+
- 'uv.lock'
5552
- 'pyproject.toml'
5653
- '**/*.py'
5754
- '**/*.toml'
@@ -64,30 +61,27 @@ jobs:
6461
with:
6562
python-version: ${{ matrix.python-version }}
6663

67-
- name: Install Poetry
68-
uses: abatilo/[email protected]
69-
with:
70-
poetry-version: $POETRY_VERSION
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v6
7166

7267
- name: Install dependencies
7368
shell: bash
7469
run: |
75-
poetry self add setuptools wheel
76-
poetry run python -m pip install gensim
77-
poetry install
70+
uv sync --extra dev
71+
uv pip install gensim
7872
7973
- name: Check
8074
run: |
81-
poetry run poe check
75+
uv run poe check
8276
8377
- name: Build
8478
run: |
85-
poetry build
79+
uv build
8680
8781
- name: Unit Test
8882
run: |
89-
poetry run poe test_unit
83+
uv run poe test_unit
9084
9185
- name: Verb Test
9286
run: |
93-
poetry run poe test_verbs
87+
uv run poe test_verbs

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

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ concurrency:
2626
# only run the for the latest commit
2727
cancel-in-progress: true
2828

29-
env:
30-
POETRY_VERSION: 1.8.3
31-
3229
jobs:
3330
python-ci:
3431
# skip draft PRs
@@ -51,7 +48,7 @@ jobs:
5148
filters: |
5249
python:
5350
- 'graphrag/**/*'
54-
- 'poetry.lock'
51+
- 'uv.lock'
5552
- 'pyproject.toml'
5653
- '**/*.py'
5754
- '**/*.toml'
@@ -64,25 +61,24 @@ jobs:
6461
with:
6562
python-version: ${{ matrix.python-version }}
6663

67-
- name: Install Poetry
68-
uses: abatilo/[email protected]
69-
with:
70-
poetry-version: $POETRY_VERSION
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v6
7166

7267
- name: Install dependencies
7368
shell: bash
7469
run: |
75-
poetry self add setuptools wheel
76-
poetry run python -m pip install gensim
77-
poetry install
70+
uv sync --extra dev
71+
uv pip install gensim
7872
7973
- name: Build
8074
run: |
81-
poetry build
75+
uv build
8276
83-
- name: Install Azurite
84-
id: azuright
85-
uses: potatoqualitee/[email protected]
77+
- name: Install and start Azurite
78+
shell: bash
79+
run: |
80+
npm install -g azurite
81+
azurite --silent --skipApiVersionCheck --location /tmp/azurite --debug /tmp/azurite-debug.log &
8682
8783
# For more information on installation/setup of Azure Cosmos DB Emulator
8884
# https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux%2Cpython&pivots=api-nosql
@@ -97,4 +93,4 @@ jobs:
9793
9894
- name: Integration Test
9995
run: |
100-
poetry run poe test_integration
96+
uv run poe test_integration

.github/workflows/python-notebook-tests.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ concurrency:
2626
# Only run the for the latest commit
2727
cancel-in-progress: true
2828

29-
env:
30-
POETRY_VERSION: 1.8.3
31-
3229
jobs:
3330
python-ci:
3431
# skip draft PRs
@@ -54,7 +51,7 @@ jobs:
5451
filters: |
5552
python:
5653
- 'graphrag/**/*'
57-
- 'poetry.lock'
54+
- 'uv.lock'
5855
- 'pyproject.toml'
5956
- '**/*.py'
6057
- '**/*.toml'
@@ -66,18 +63,15 @@ jobs:
6663
with:
6764
python-version: ${{ matrix.python-version }}
6865

69-
- name: Install Poetry
70-
uses: abatilo/[email protected]
71-
with:
72-
poetry-version: $POETRY_VERSION
66+
- name: Install uv
67+
uses: astral-sh/setup-uv@v6
7368

7469
- name: Install dependencies
7570
shell: bash
7671
run: |
77-
poetry self add setuptools wheel
78-
poetry run python -m pip install gensim
79-
poetry install
72+
uv sync --extra dev
73+
uv pip install gensim
8074
8175
- name: Notebook Test
8276
run: |
83-
poetry run poe test_notebook
77+
uv run poe test_notebook

.github/workflows/python-publish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
branches: [main]
77

88
env:
9-
POETRY_VERSION: "1.8.3"
109
PYTHON_VERSION: "3.10"
1110

1211
jobs:
@@ -31,21 +30,19 @@ jobs:
3130
with:
3231
python-version: ${{ env.PYTHON_VERSION }}
3332

34-
- name: Install Poetry
35-
uses: abatilo/[email protected]
36-
with:
37-
poetry-version: ${{ env.POETRY_VERSION }}
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v6
3835

3936
- name: Install dependencies
4037
shell: bash
41-
run: poetry install
38+
run: uv sync
4239

4340
- name: Export Publication Version
44-
run: echo "version=`poetry version --short`" >> $GITHUB_OUTPUT
41+
run: echo "version=$(uv version --short)" >> $GITHUB_OUTPUT
4542

4643
- name: Build Distributable
4744
shell: bash
48-
run: poetry build
45+
run: uv build
4946

5047
- name: Publish package distributions to PyPI
5148
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/python-smoke-tests.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ concurrency:
2626
# Only run the for the latest commit
2727
cancel-in-progress: true
2828

29-
env:
30-
POETRY_VERSION: 1.8.3
31-
3229
jobs:
3330
python-ci:
3431
# skip draft PRs
@@ -68,7 +65,7 @@ jobs:
6865
filters: |
6966
python:
7067
- 'graphrag/**/*'
71-
- 'poetry.lock'
68+
- 'uv.lock'
7269
- 'pyproject.toml'
7370
- '**/*.py'
7471
- '**/*.toml'
@@ -81,33 +78,32 @@ jobs:
8178
with:
8279
python-version: ${{ matrix.python-version }}
8380

84-
- name: Install Poetry
85-
uses: abatilo/[email protected]
86-
with:
87-
poetry-version: $POETRY_VERSION
81+
- name: Install uv
82+
uses: astral-sh/setup-uv@v6
8883

8984
- name: Install dependencies
9085
shell: bash
9186
run: |
92-
poetry self add setuptools wheel
93-
poetry run python -m pip install gensim
94-
poetry install
87+
uv sync --extra dev
88+
uv pip install gensim
9589
9690
- name: Build
9791
run: |
98-
poetry build
92+
uv build
9993
100-
- name: Install Azurite
101-
id: azuright
102-
uses: potatoqualitee/[email protected]
94+
- name: Install and start Azurite
95+
shell: bash
96+
run: |
97+
npm install -g azurite
98+
azurite --silent --skipApiVersionCheck --location /tmp/azurite --debug /tmp/azurite-debug.log &
10399
104100
- name: Smoke Test
105101
if: steps.changes.outputs.python == 'true'
106102
run: |
107-
poetry run poe test_smoke
103+
uv run poe test_smoke
108104
109105
- uses: actions/upload-artifact@v4
110106
if: always()
111107
with:
112-
name: smoke-test-artifacts-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ runner.os }}
108+
name: smoke-test-artifacts-${{ matrix.python-version }}-${{ runner.os }}
113109
path: tests/fixtures/*

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Python Artifacts
22
python/*/lib/
33
dist/
4+
build/
5+
*.egg-info/
46

57
# Test Output
68
.coverage
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "minor",
3+
"description": "swap package management from Poetry -> UV"
4+
}

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Indexer",
77
"type": "debugpy",
88
"request": "launch",
9-
"module": "poetry",
9+
"module": "uv",
1010
"args": [
1111
"poe", "index",
1212
"--root", "<path_to_ragtest_root_demo>"
@@ -16,7 +16,7 @@
1616
"name": "Query",
1717
"type": "debugpy",
1818
"request": "launch",
19-
"module": "poetry",
19+
"module": "uv",
2020
"args": [
2121
"poe", "query",
2222
"--root", "<path_to_ragtest_root_demo>",
@@ -28,7 +28,7 @@
2828
"name": "Prompt Tuning",
2929
"type": "debugpy",
3030
"request": "launch",
31-
"module": "poetry",
31+
"module": "uv",
3232
"args": [
3333
"poe", "prompt-tune",
3434
"--config",

.vscode/settings.json

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,8 @@
11
{
2-
"search.exclude": {
3-
"**/.yarn": true,
4-
"**/.pnp.*": true
5-
},
62
"editor.formatOnSave": false,
7-
"eslint.nodePath": ".yarn/sdks",
8-
"typescript.tsdk": ".yarn/sdks/typescript/lib",
9-
"typescript.enablePromptUseWorkspaceTsdk": true,
10-
"javascript.preferences.importModuleSpecifier": "relative",
11-
"javascript.preferences.importModuleSpecifierEnding": "js",
12-
"typescript.preferences.importModuleSpecifier": "relative",
13-
"typescript.preferences.importModuleSpecifierEnding": "js",
143
"explorer.fileNesting.enabled": true,
15-
"explorer.fileNesting.patterns": {
16-
"*.ts": "${capture}.ts, ${capture}.hooks.ts, ${capture}.hooks.tsx, ${capture}.contexts.ts, ${capture}.stories.tsx, ${capture}.story.tsx, ${capture}.spec.tsx, ${capture}.base.ts, ${capture}.base.tsx, ${capture}.types.ts, ${capture}.styles.ts, ${capture}.styles.tsx, ${capture}.utils.ts, ${capture}.utils.tsx, ${capture}.constants.ts, ${capture}.module.scss, ${capture}.module.css, ${capture}.md",
17-
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
18-
"*.jsx": "${capture}.js",
19-
"*.tsx": "${capture}.ts, ${capture}.hooks.ts, ${capture}.hooks.tsx, ${capture}.contexts.ts, ${capture}.stories.tsx, ${capture}.story.tsx, ${capture}.spec.tsx, ${capture}.base.ts, ${capture}.base.tsx, ${capture}.types.ts, ${capture}.styles.ts, ${capture}.styles.tsx, ${capture}.utils.ts, ${capture}.utils.tsx, ${capture}.constants.ts, ${capture}.module.scss, ${capture}.module.css, ${capture}.md, ${capture}.css",
20-
"tsconfig.json": "tsconfig.*.json",
21-
"package.json": "package-lock.json, turbo.json, tsconfig.json, rome.json, biome.json, .npmignore, dictionary.txt, cspell.config.yaml",
22-
"README.md": "*.md, LICENSE, CODEOWNERS",
23-
".eslintrc": ".eslintignore",
24-
".prettierrc": ".prettierignore",
25-
".gitattributes": ".gitignore",
26-
".yarnrc.yml": "yarn.lock, .pnp.*",
27-
"jest.config.js": "jest.setup.mjs",
28-
"pyproject.toml": "poetry.lock, poetry.toml, mkdocs.yaml",
29-
"cspell.config.yaml": "dictionary.txt"
30-
},
31-
"azureFunctions.postDeployTask": "npm install (functions)",
32-
"azureFunctions.projectLanguage": "TypeScript",
33-
"azureFunctions.projectRuntime": "~4",
344
"debug.internalConsoleOptions": "neverOpen",
35-
"azureFunctions.preDeployTask": "npm prune (functions)",
36-
"appService.zipIgnorePattern": [
37-
"node_modules{,/**}",
38-
".vscode{,/**}"
39-
],
40-
"python.defaultInterpreterPath": "python/services/.venv/bin/python",
5+
"python.defaultInterpreterPath": "${workspaceRoot}/.venv/bin/python",
416
"python.languageServer": "Pylance",
427
"cSpell.customDictionaries": {
438
"project-words": {

0 commit comments

Comments
 (0)