14
14
15
15
env :
16
16
PYTHON_VERSION : " 3.11"
17
- POETRY_VERSION : " 2.0.1"
17
+ UV_VERSION : " 0.7.13"
18
+ DEFAULT_REDIS_IMAGE : " 8.0.2"
18
19
19
20
jobs :
20
21
service-tests :
@@ -24,11 +25,10 @@ jobs:
24
25
HF_HOME : ${{ github.workspace }}/hf_cache
25
26
steps :
26
27
- name : Check out repository
27
- uses : actions/checkout@v3
28
+ uses : actions/checkout@v4
28
29
29
30
- name : Cache HuggingFace Models
30
- id : hf-cache
31
- uses : actions/cache@v3
31
+ uses : actions/cache@v4
32
32
with :
33
33
path : hf_cache
34
34
key : ${{ runner.os }}-hf-cache
@@ -38,20 +38,24 @@ jobs:
38
38
mkdir -p ~/.huggingface
39
39
echo '{"token":"${{ secrets.HF_TOKEN }}"}' > ~/.huggingface/token
40
40
41
- - name : Set up Python 3.11
42
- uses : actions/setup-python@v4
41
+ - name : Install Python
42
+ uses : actions/setup-python@v5
43
43
with :
44
44
python-version : ${{ env.PYTHON_VERSION }}
45
- cache : pip
46
45
47
- - name : Install Poetry
48
- uses : snok/install-poetry@v1
46
+ - name : Install uv
47
+ uses : astral-sh/setup-uv@v6
49
48
with :
50
- version : ${{ env.POETRY_VERSION }}
49
+ version : ${{ env.UV_VERSION }}
50
+ enable-cache : true
51
+ python-version : ${{ env.PYTHON_VERSION }} # sets UV_PYTHON
52
+ cache-dependency-glob : |
53
+ pyproject.toml
54
+ uv.lock
51
55
52
56
- name : Install dependencies
53
57
run : |
54
- poetry install --all-extras
58
+ uv sync --group test --frozen
55
59
56
60
- name : Authenticate to Google Cloud
57
61
uses : google-github-actions/auth@v1
61
65
- name : Run full test suite and prime the HF cache
62
66
env :
63
67
HF_TOKEN : ${{ secrets.HF_TOKEN }}
64
- HF_HOME : ${{ github.workspace }}/hf_cache
65
68
OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
66
69
GCP_LOCATION : ${{ secrets.GCP_LOCATION }}
67
70
GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
@@ -87,45 +90,48 @@ jobs:
87
90
fail-fast : false
88
91
matrix :
89
92
# 3.11 tests are run in the service-tests job
90
- python-version : ["3.9", "3.10", 3.12, 3.13]
93
+ python-version : ["3.9", "3.10", " 3.12", " 3.13" ]
91
94
redis-py-version : ["5.x", "6.x"]
92
- redis-version : ["6.2.6-v9", "latest", "8.0.1"]
93
-
95
+ redis-version : ["6.2.6-v9", "latest", "${{ env.DEFAULT_REDIS_IMAGE }}"]
94
96
steps :
95
97
- name : Check out repository
96
- uses : actions/checkout@v3
98
+ uses : actions/checkout@v4
97
99
98
100
- name : Cache HuggingFace Models
99
- uses : actions/cache@v3
101
+ uses : actions/cache@v4
100
102
with :
101
103
path : hf_cache
102
104
key : ${{ runner.os }}-hf-cache
103
105
104
- - name : Set up Python ${{ matrix.python-version }}
105
- uses : actions/setup-python@v4
106
+ - name : Install Python
107
+ uses : actions/setup-python@v5
106
108
with :
107
109
python-version : ${{ matrix.python-version }}
108
- cache : pip
109
110
110
- - name : Install Poetry
111
- uses : snok/install-poetry@v1
111
+ - name : Install uv
112
+ uses : astral-sh/setup-uv@v6
112
113
with :
113
- version : ${{ env.POETRY_VERSION }}
114
+ version : ${{ env.UV_VERSION }}
115
+ enable-cache : true
116
+ python-version : ${{ matrix.python-version }} # sets UV_PYTHON
117
+ cache-dependency-glob : |
118
+ pyproject.toml
119
+ uv.lock
114
120
115
121
- name : Install dependencies
116
122
run : |
117
- poetry install --all-extras
123
+ uv sync --group test --frozen
118
124
119
125
# Install right redis version based on redis py
120
126
if [[ "${{ matrix.redis-py-version }}" == "5.x" ]]; then
121
- poetry run pip install "redis>=5.0.0 ,<6.0.0 "
127
+ uv pip install "redis>=5,<6"
122
128
else
123
- poetry run pip install "redis>=6.0.0 ,<7.0.0 "
129
+ uv pip install "redis>=6,<7"
124
130
fi
125
131
126
132
- name : Set Redis image name
127
133
run : |
128
- if [[ "${{ matrix.redis-version }}" == "8.0.1 " ]]; then
134
+ if [[ "${{ matrix.redis-version }}" == "${{ env.DEFAULT_REDIS_IMAGE }} " ]]; then
129
135
echo "REDIS_IMAGE=redis:${{ matrix.redis-version }}" >> $GITHUB_ENV
130
136
else
131
137
echo "REDIS_IMAGE=redis/redis-stack-server:${{ matrix.redis-version }}" >> $GITHUB_ENV
@@ -138,7 +144,6 @@ jobs:
138
144
139
145
- name : Run tests
140
146
env :
141
- HF_HOME : ${{ github.workspace }}/hf_cache
142
147
GCP_LOCATION : ${{ secrets.GCP_LOCATION }}
143
148
GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
144
149
run : |
@@ -147,7 +152,6 @@ jobs:
147
152
- name : Run notebooks
148
153
if : matrix.redis-py-version == '6.x' && matrix.redis-version == 'latest'
149
154
env :
150
- HF_HOME : ${{ github.workspace }}/hf_cache
151
155
OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
152
156
GCP_LOCATION : ${{ secrets.GCP_LOCATION }}
153
157
GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
@@ -171,20 +175,24 @@ jobs:
171
175
- name : Check out repository
172
176
uses : actions/checkout@v3
173
177
174
- - name : Set up Python
175
- uses : actions/setup-python@v4
178
+ - name : Install Python
179
+ uses : actions/setup-python@v5
176
180
with :
177
181
python-version : ${{ env.PYTHON_VERSION }}
178
- cache : pip
179
182
180
- - name : Install Poetry
181
- uses : snok/install-poetry@v1
183
+ - name : Install uv
184
+ uses : astral-sh/setup-uv@v6
182
185
with :
183
- version : ${{ env.POETRY_VERSION }}
184
-
186
+ version : ${{ env.UV_VERSION }}
187
+ enable-cache : true
188
+ python-version : ${{ env.PYTHON_VERSION }} # sets UV_PYTHON
189
+ cache-dependency-glob : |
190
+ pyproject.toml
191
+ uv.lock
192
+
185
193
- name : Install dependencies
186
194
run : |
187
- poetry install --all-extras
195
+ uv sync --group docs --frozen
188
196
189
197
- name : Build docs
190
198
run : |
0 commit comments