Repository navigation
268 lines (241 loc) · 8.61 KB
/
Copy pathpython.yml
File metadata and controls
268 lines (241 loc) · 8.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: Python
on:
push:
branches: [main]
pull_request:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python-version }}, ${{ matrix.backend.name }}
runs-on: ubuntu-26.04
timeout-minutes: 5
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
# A bug that depends on the Python version shows up on any backend,
# and a bug that depends on the server shows up on any Python. So
# every Python runs the in-memory backend (burner-redis is Python
# code) and one real server, and each other server runs on as few
# Pythons as it needs. Every backend runs against the latest
# redis-py; the older majors live in the test-redis-py job below.
backend:
- name: "Memory"
redis-version: "memory"
- name: "Redis 8"
redis-version: "8.10"
include:
# The oldest supported server with the oldest and newest Python
- python-version: "3.10"
backend:
name: "Redis 6"
redis-version: "6.2"
- python-version: "3.14"
backend:
name: "Redis 6"
redis-version: "6.2"
# redis-py's cluster client has its own async code, so cluster mode
# runs on the oldest and newest Python. It emits ResourceWarning
# about unclosed pub/sub sockets during teardown, which we ignore
# until redis-py fixes it.
- python-version: "3.10"
backend:
name: "Redis 8 Cluster"
redis-version: "8.10-cluster"
pytest-args: "-W ignore::ResourceWarning"
- python-version: "3.14"
backend:
name: "Redis 8 Cluster"
redis-version: "8.10-cluster"
pytest-args: "-W ignore::ResourceWarning"
# Valkey and ACL differ only on the server, so one Python covers them
- python-version: "3.14"
backend:
name: "Valkey 8"
redis-version: "valkey-8.0"
- python-version: "3.14"
backend:
name: "Valkey 9"
redis-version: "valkey-9.1"
- python-version: "3.14"
backend:
name: "Redis 8 with ACL"
redis-version: "8.10-acl"
- python-version: "3.14"
backend:
name: "Valkey 9 with ACL"
redis-version: "valkey-9.1-acl"
# The ACL server again, with the credentials from a credential
# provider instead of the URL
- python-version: "3.14"
backend:
name: "Redis 8 with credential provider"
redis-version: "8.10-provider"
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package redis
- name: Run tests
env:
REDIS_VERSION: ${{ matrix.backend.redis-version }}
run: uv run pytest --ignore=tests/cli --cov-branch --cov-config=.coveragerc-core --cov-fail-under=100 --cov-report=xml --cov-report=term-missing:skip-covered --junitxml=junit.xml -o junit_family=legacy ${{ matrix.pytest-args }}
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-cli:
name: Python ${{ matrix.python-version }}, CLI
runs-on: ubuntu-26.04
timeout-minutes: 4
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis>=6'
- name: Run CLI tests
env:
REDIS_VERSION: "8.10"
run: >
uv run pytest tests/cli/
-o 'addopts=--import-mode=importlib'
--numprocesses=logical --maxprocesses=4
--cov=src/docket/cli --cov=tests/cli
--cov-config=.coveragerc-cli
--cov-branch --cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
--timeout=30
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: cli-python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-windows:
name: Python ${{ matrix.python-version }}, Windows
runs-on: windows-latest
timeout-minutes: 6
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis>=6'
- name: Run tests
env:
REDIS_VERSION: memory
run: >
uv run pytest --ignore=tests/cli
--cov-branch --cov-config=.coveragerc-core
--cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: windows-python-${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results
test-redis-py:
name: Python 3.14, Redis 8.10, redis-py ${{ matrix.redis-py.name }}
runs-on: ubuntu-26.04
timeout-minutes: 4
defaults:
run:
working-directory: python
strategy:
fail-fast: false
matrix:
# The client is what varies, so we pin one Python and one real Redis
# and run the full suite against each redis-py major we support. A
# real, standalone Redis is required since the bug this guards (#425)
# is a client socket timeout.
redis-py:
- { name: "6", spec: ">=6,<7" }
- { name: "7", spec: ">=7,<8" }
- { name: "8", spec: ">=8" }
steps:
- uses: actions/checkout@v7
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.14"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
run: uv sync --upgrade-package 'redis${{ matrix.redis-py.spec }}'
- name: Run tests
env:
REDIS_VERSION: "8.10"
run: >
uv run pytest --ignore=tests/cli
--cov-branch --cov-config=.coveragerc-core
--cov-fail-under=100
--cov-report=xml --cov-report=term-missing:skip-covered
--junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: redis-py-${{ matrix.redis-py.name }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
report_type: test_results