Skip to content

Commit 661093a

Browse files
authored
[BLD]: use uv in CI (#4581)
## Description of changes Reduces Python setup time by >10x from 1-2m to 10s by replacing pip with uv (in pip compatibility mode) and removing an unnecessary apt step. ## Test plan _How are these changes tested?_ Workflows pass. ## Documentation Changes _Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_ n/a
1 parent 71c953d commit 661093a

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

.github/actions/python/action.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ inputs:
88
runs:
99
using: "composite"
1010
steps:
11-
11+
- name: Install uv
12+
uses: astral-sh/setup-uv@v6
13+
with:
14+
enable-cache: true
1215
- name: Set up Python 3.9 for protos
1316
uses: useblacksmith/setup-python@v6
1417
# NOTE(hammadb) Blacksmith does not support windows, so we use the official action for windows and
1518
# skip it on other platforms
1619
if: runner.os != 'Windows'
1720
with:
1821
python-version: "3.9"
19-
cache: "pip"
20-
cache-dependency-path: "requirements*.txt"
2122
- name: Set up Python 3.9 for protos (Windows)
2223
if: runner.os == 'Windows'
2324
uses: actions/setup-python@v5
2425
with:
2526
python-version: "3.9"
26-
cache: "pip"
27-
cache-dependency-path: "requirements*.txt"
2827

2928
- name: Install proto dependencies
3029
run: |
31-
python -m pip install grpcio==1.58.0 grpcio-tools==1.58.0
30+
uv pip install --system grpcio==1.58.0 grpcio-tools==1.58.0
3231
shell: bash
3332
- name: Generate Proto Files
3433
if: runner.os != 'Windows'
@@ -40,30 +39,24 @@ runs:
4039
shell: cmd
4140
- name: Uninstall proto dependencies
4241
run: |
43-
python -m pip uninstall -y grpcio grpcio-tools
42+
uv pip uninstall --system grpcio grpcio-tools
4443
shell: bash
4544
- name: Set up Python ${{ inputs.python-version }}
4645
uses: useblacksmith/setup-python@v6
4746
with:
4847
python-version: ${{ inputs.python-version }}
49-
cache: "pip"
50-
cache-dependency-path: "requirements*.txt"
5148
- name: Set up Python ${{ inputs.python-version }} (Windows)
5249
if: runner.os == 'Windows'
5350
uses: actions/setup-python@v5
5451
with:
5552
python-version: ${{ inputs.python-version }}
56-
cache: "pip"
57-
cache-dependency-path: "requirements*.txt"
5853
- name: Install dependencies
5954
run: |
60-
python -m pip install -r requirements.txt && python -m pip install -r requirements_dev.txt
55+
uv pip install --system -r requirements.txt -r requirements_dev.txt
6156
shell: bash
6257
- name: Install protobuf compiler (protoc) - Linux
6358
if: runner.os != 'Windows'
6459
run: |
65-
sudo apt-get update
66-
sudo apt-get install -y wget unzip
6760
wget https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protoc-28.2-linux-x86_64.zip
6861
sudo unzip protoc-28.2-linux-x86_64.zip -d /usr/local/
6962
sudo rm protoc-28.2-linux-x86_64.zip

0 commit comments

Comments
 (0)