Skip to content

Commit ff2c99f

Browse files
committed
UV Migration
1 parent 3221f9a commit ff2c99f

File tree

45 files changed

+6068
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6068
-311
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Setup UV'
2+
description: 'Install UV package manager'
3+
outputs:
4+
uv-version:
5+
description: 'The installed UV version'
6+
value: ${{ steps.get-version.outputs.version }}
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Install UV (Unix)
11+
if: runner.os != 'Windows'
12+
shell: bash
13+
run: |
14+
curl -LsSf https://astral.sh/uv/install.sh | sh
15+
echo "$HOME/.local/bin" >> $GITHUB_PATH
16+
17+
- name: Install UV (Windows)
18+
if: runner.os == 'Windows'
19+
shell: pwsh
20+
run: |
21+
irm https://astral.sh/uv/install.ps1 | iex
22+
echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
23+
24+
- name: Verify UV installation
25+
id: get-version
26+
shell: bash
27+
run: |
28+
uv --version
29+
echo "version=$(uv --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
30+

.github/actions/uv-sync/action.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: 'UV Sync Dependencies'
2+
description: 'Sync UV workspace dependencies with optional extras and local wheels'
3+
inputs:
4+
workspace-member:
5+
description: 'Specific workspace member to sync (optional, default: all)'
6+
required: false
7+
default: ''
8+
dependency-groups:
9+
description: 'Comma-separated dependency groups to install, e.g., "testing-full,samples"'
10+
required: false
11+
default: ''
12+
local-wheel-dir:
13+
description: 'Path to directory containing local wheels to install'
14+
required: false
15+
default: ''
16+
packages:
17+
description: 'Semicolon-separated list of packages to install from wheels, e.g., "openvino;openvino_tokenizers[transformers];openvino_genai"'
18+
required: false
19+
default: ''
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Install local wheels
24+
if: inputs.local-wheel-dir != '' && inputs.packages != ''
25+
shell: bash
26+
run: |
27+
cd ${{ github.workspace }}/src
28+
29+
if [ -d "${{ inputs.local-wheel-dir }}" ]; then
30+
echo "Installing local wheels from ${{ inputs.local-wheel-dir }}"
31+
32+
IFS=';' read -ra PACKAGES <<< "${{ inputs.packages }}"
33+
for pkg in "${PACKAGES[@]}"; do
34+
echo "Installing ${pkg}"
35+
uv pip install "$pkg" --find-links "${{ inputs.local-wheel-dir }}" --prerelease=allow
36+
done
37+
fi
38+
39+
- name: Sync dependency groups
40+
if: inputs.dependency-groups != ''
41+
shell: bash
42+
run: |
43+
cd ${{ github.workspace }}/src
44+
45+
IFS=',' read -ra GROUPS <<< "${{ inputs.dependency-groups }}"
46+
for group in "${GROUPS[@]}"; do
47+
echo "Syncing dependency group: ${group}"
48+
uv sync --group "${group}" --no-install-project --prerelease=allow
49+
done
50+
51+
- name: Sync workspace
52+
if: inputs.workspace-member != ''
53+
shell: bash
54+
run: |
55+
cd ${{ github.workspace }}/src
56+
57+
SYNC_CMD="uv sync --package ${{ inputs.workspace-member }} --prerelease=allow"
58+
59+
echo "Running: $SYNC_CMD"
60+
$SYNC_CMD
61+

.github/dependabot.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,12 @@ updates:
2626
versioning-strategy: increase-if-necessary
2727

2828
#
29-
# Python dependencies
29+
# Python dependencies (UV workspace)
3030
#
31-
- package-ecosystem: "pip"
32-
directory: "./tests/python_tests/"
33-
schedule:
34-
interval: "daily"
35-
time: "09:00"
36-
timezone: "Europe/Dublin"
37-
versioning-strategy: increase-if-necessary
38-
39-
- package-ecosystem: "pip"
40-
directory: "./tools/llm_bench/"
41-
schedule:
42-
interval: "daily"
43-
time: "09:00"
44-
timezone: "Europe/Dublin"
45-
versioning-strategy: increase-if-necessary
46-
47-
- package-ecosystem: "pip"
48-
directory: "./tools/who_what_benchmark/"
49-
schedule:
50-
interval: "daily"
51-
time: "09:00"
52-
timezone: "Europe/Dublin"
53-
versioning-strategy: increase-if-necessary
54-
55-
- package-ecosystem: "pip"
56-
directory: "samples/"
57-
schedule:
58-
interval: "daily"
59-
time: "09:00"
60-
timezone: "Europe/Dublin"
61-
versioning-strategy: increase-if-necessary
62-
63-
- package-ecosystem: "pip"
31+
- package-ecosystem: "uv"
6432
directory: "/"
6533
schedule:
6634
interval: "daily"
6735
time: "09:00"
6836
timezone: "Europe/Dublin"
69-
versioning-strategy: increase-if-necessary
37+
open-pull-requests-limit: 5

.github/workflows/linux.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -583,13 +583,17 @@ jobs:
583583
path: ${{ env.INSTALL_DIR }}
584584
merge-multiple: true
585585

586+
- name: Setup UV
587+
if: ${{ matrix.test.run_condition }}
588+
uses: ./src/.github/actions/setup-uv
589+
586590
- name: Install GenAI Wheels
587591
if: ${{ matrix.test.run_condition }}
588-
uses: ./src/.github/actions/install_wheel
592+
uses: ./src/.github/actions/uv-sync
589593
with:
590594
packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench"
591-
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
592-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
595+
dependency-groups: "testing-full"
596+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
593597

594598
- name: Tests
595599
if: ${{ matrix.test.run_condition }}
@@ -690,13 +694,17 @@ jobs:
690694
pigz -dc ${{ env.GENAI_SAMPLES_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }}
691695
working-directory: ${{ env.INSTALL_DIR }}
692696

697+
- name: Setup UV
698+
if: ${{ matrix.test.run_condition }}
699+
uses: ./src/.github/actions/setup-uv
700+
693701
- name: Install GenAI wheels
694702
if: ${{ matrix.test.run_condition }}
695-
uses: ./src/.github/actions/install_wheel
703+
uses: ./src/.github/actions/uv-sync
696704
with:
697705
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
698-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
699-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
706+
dependency-groups: "samples,testing-full"
707+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
700708

701709
- name: Setup Node
702710
if: ${{ matrix.test.run_condition }}
@@ -776,12 +784,16 @@ jobs:
776784
- name: Fix C++ samples permissions
777785
run: chmod +x ${{ env.INSTALL_DIR }}/samples_bin/*
778786

787+
- name: Setup UV
788+
uses: ./src/.github/actions/setup-uv
789+
779790
- name: Install GenAI wheels
780-
uses: ./src/.github/actions/install_wheel
791+
uses: ./src/.github/actions/uv-sync
781792
with:
782793
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
783-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt;${{ env.SRC_DIR }}/tools/llm_bench/requirements.txt"
784-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
794+
dependency-groups: "samples,testing-full"
795+
workspace-member: "llm_bench"
796+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
785797

786798
- name: gtests unit tests
787799
if: ${{ fromJSON(needs.smart_ci.outputs.affected_components).continuous_batching }}
@@ -919,12 +931,15 @@ jobs:
919931
-B ${{ env.BUILD_DIR }}
920932
cmake --build ${{ env.BUILD_DIR}} --config Release --parallel $(nproc) --target py_openvino_genai --verbose
921933
934+
- name: Setup UV
935+
uses: ./src/.github/actions/setup-uv
936+
922937
- name: Install dependencies
923-
uses: ./src/.github/actions/install_wheel
938+
uses: ./src/.github/actions/uv-sync
924939
with:
925-
packages: openvino;openvino_tokenizers[transformers]
926-
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
927-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
940+
packages: "openvino;openvino_tokenizers[transformers]"
941+
dependency-groups: "testing-full"
942+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
928943

929944
- name: Run test_llm_pipeline.py when -DENABLE_XGRAMMAR=OFF
930945
env:

.github/workflows/mac.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,17 @@ jobs:
510510
python-version: ${{ env.PYTHON_VERSION }}
511511
cache: 'pip'
512512

513+
- name: Setup UV
514+
if: ${{ matrix.test.run_condition }}
515+
uses: ./src/.github/actions/setup-uv
516+
513517
- name: Install GenAI Wheels
514518
if: ${{ matrix.test.run_condition }}
515-
uses: ./src/.github/actions/install_wheel
519+
uses: ./src/.github/actions/uv-sync
516520
with:
517521
packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench"
518-
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
519-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
522+
dependency-groups: "testing-full"
523+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
520524

521525
- name: Tests
522526
if: ${{ matrix.test.run_condition }}
@@ -592,13 +596,17 @@ jobs:
592596
python-version: ${{ env.PYTHON_VERSION }}
593597
cache: 'pip'
594598

599+
- name: Setup UV
600+
if: ${{ matrix.test.run_condition }}
601+
uses: ./src/.github/actions/setup-uv
602+
595603
- name: Install GenAI wheels
596604
if: ${{ matrix.test.run_condition }}
597-
uses: ./src/.github/actions/install_wheel
605+
uses: ./src/.github/actions/uv-sync
598606
with:
599607
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
600-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
601-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
608+
dependency-groups: "samples,testing-full"
609+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
602610

603611
# transformers >= 4.52 require torch >= 2.6 and raise an error otherwise:
604612
# ValueError: Due to a serious vulnerability issue in `torch.load`, even with `weights_only=True`, we now require users to upgrade torch to at least v2.6 in order to use the function. This version restriction does not apply when loading files with safetensors.
@@ -684,12 +692,15 @@ jobs:
684692
python-version: ${{ env.PYTHON_VERSION }}
685693
cache: 'pip'
686694

695+
- name: Setup UV
696+
uses: ./src/.github/actions/setup-uv
697+
687698
- name: Install GenAI wheels
688-
uses: ./src/.github/actions/install_wheel
699+
uses: ./src/.github/actions/uv-sync
689700
with:
690701
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
691-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
692-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
702+
dependency-groups: "samples,testing-full"
703+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
693704

694705
- name: gtests unit tests
695706
run: |

.github/workflows/manylinux_2_28.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,17 @@ jobs:
521521
path: ${{ env.INSTALL_DIR }}
522522
merge-multiple: true
523523

524+
- name: Setup UV
525+
if: ${{ matrix.test.run_condition }}
526+
uses: ./src/.github/actions/setup-uv
527+
524528
- name: Install GenAI Wheels
525529
if: ${{ matrix.test.run_condition }}
526-
uses: ./src/.github/actions/install_wheel
530+
uses: ./src/.github/actions/uv-sync
527531
with:
528532
packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench"
529-
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
530-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
533+
dependency-groups: "testing-full"
534+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
531535

532536
- name: Tests
533537
if: ${{ matrix.test.run_condition }}

.github/workflows/windows.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -672,13 +672,17 @@ jobs:
672672
python-version: ${{ env.PYTHON_VERSION }}
673673
cache: 'pip'
674674

675+
- name: Setup UV
676+
if: ${{ matrix.test.run_condition }}
677+
uses: ./src/.github/actions/setup-uv
678+
675679
- name: Install GenAI Wheels
676680
if: ${{ matrix.test.run_condition }}
677-
uses: ./src/.github/actions/install_wheel
681+
uses: ./src/.github/actions/uv-sync
678682
with:
679683
packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench"
680-
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
681-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
684+
dependency-groups: "testing-full"
685+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
682686

683687
- name: Tests
684688
if: ${{ matrix.test.run_condition }}
@@ -771,13 +775,17 @@ jobs:
771775
python-version: ${{ env.PYTHON_VERSION }}
772776
cache: 'pip'
773777

778+
- name: Setup UV
779+
if: ${{ matrix.test.run_condition }}
780+
uses: ./src/.github/actions/setup-uv
781+
774782
- name: Install GenAI wheels
775783
if: ${{ matrix.test.run_condition }}
776-
uses: ./src/.github/actions/install_wheel
784+
uses: ./src/.github/actions/uv-sync
777785
with:
778786
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
779-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
780-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
787+
dependency-groups: "samples,testing-full"
788+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
781789

782790
- name: Setup NodeJS
783791
if: ${{ matrix.test.run_condition }}
@@ -850,12 +858,15 @@ jobs:
850858
python-version: ${{ env.PYTHON_VERSION }}
851859
cache: 'pip'
852860

861+
- name: Setup UV
862+
uses: ./src/.github/actions/setup-uv
863+
853864
- name: Install GenAI wheels
854-
uses: ./src/.github/actions/install_wheel
865+
uses: ./src/.github/actions/uv-sync
855866
with:
856867
packages: "openvino;openvino_tokenizers[transformers];openvino_genai[testing]"
857-
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
858-
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels
868+
dependency-groups: "samples,testing-full"
869+
local-wheel-dir: ${{ env.INSTALL_DIR }}/wheels
859870

860871
- name: gtests unit tests
861872
run: |

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ Continuous batching functionality is used within OpenVINO Model Server (OVMS) to
7171

7272
```sh
7373
# Installing OpenVINO GenAI via pip
74-
# export-requirements are not required to run models, only to convert and compress
75-
pip install openvino-genai --requirement ./samples/export-requirements.txt --requirement ./samples/deployment-requirements.txt
74+
pip install openvino-genai
7675

77-
# (Optional) Install (TBD) to be able to download models from Model Scope
76+
# Or using UV (recommended for development)
77+
uv pip install openvino-genai
78+
79+
# With sample dependencies
80+
uv sync --group samples --group samples-export
7881
```
7982

8083
<a id="text-to-text"></a>

0 commit comments

Comments
 (0)