-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathconfig.yml
More file actions
368 lines (346 loc) · 9.67 KB
/
config.yml
File metadata and controls
368 lines (346 loc) · 9.67 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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.4.8
executors:
docker-container:
parameters:
python_version:
description: "python version"
default: "3.12"
type: string
docker:
- image: cimg/python:<<parameters.python_version>>-browsers
commands:
test_core:
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv lock --check
uv sync --extra dev_core
- run:
name: List installed packages and python version
command: |
source .venv/bin/activate
uv pip list
python --version
- run:
name: Test core
command: |
source .venv/bin/activate
python -m pytest tests/test_core
no_output_timeout: 20m
test_optional:
parameters:
pandas_version:
type: string
numpy_version:
type: string
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv sync --extra dev_optional
- when:
condition:
not:
equal:
- <<parameters.pandas_version>>
- ""
steps:
- run:
name: Install pandas
command: |
source .venv/bin/activate
uv pip install pandas==<<parameters.pandas_version>> numpy==<<parameters.numpy_version>>
- run:
name: Test core
command: |
source .venv/bin/activate
python -m pytest tests/test_core
no_output_timeout: 20m
- run:
name: List installed packages and python version
command: |
source .venv/bin/activate
uv pip list
python --version
- run:
name: Test optional
command: |
source .venv/bin/activate
python -m pytest tests/test_optional
no_output_timeout: 40m
- run:
name: Test utils
command: |
source .venv/bin/activate
python -m pytest tests/test_plotly_utils/
no_output_timeout: 20m
- run:
name: Test io
command: |
source .venv/bin/activate
python -m pytest tests/test_io
no_output_timeout: 20m
- run:
name: Test dependencies not imported
command: |
source .venv/bin/activate
python -m pytest -x test_init/test_dependencies_not_imported.py
- run:
name: Test lazy imports
command: |
source .venv/bin/activate
python -m pytest -x test_init/test_lazy_imports.py
test_io_kaleido_v0:
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv sync --extra dev_optional
# Install Kaleido v0 instead of the v1 specified in requirements_optional.txt
uv pip uninstall kaleido
uv pip install kaleido==0.2.1
- run:
name: List installed packages and python version
command: |
source .venv/bin/activate
uv pip list
python --version
- run:
name: Test plotly.io image output with Kaleido v0
command: |
source .venv/bin/activate
python -m pytest tests/test_optional/test_kaleido
no_output_timeout: 20m
jobs:
check-code-formatting:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run:
name: Install ruff
command: |
uv venv
source .venv/bin/activate
uv sync --extra dev_core
- run:
name: Check handwritten code with ruff
command: |
source .venv/bin/activate
ruff format --check .
test_core_py:
parameters:
python_version:
default: "3.12"
type: string
executor:
name: docker-container
python_version: <<parameters.python_version>>
steps:
- test_core
test_optional_py:
parameters:
python_version:
default: "3.12"
type: string
pandas_version:
default: ""
type: string
numpy_version:
default: ""
type: string
executor:
name: docker-container
python_version: <<parameters.python_version>>
steps:
- test_optional:
pandas_version: <<parameters.pandas_version>>
numpy_version: <<parameters.numpy_version>>
test_kaleido_v0:
parameters:
python_version:
default: "3.12"
type: string
executor:
name: docker-container
python_version: <<parameters.python_version>>
steps:
- test_io_kaleido_v0
# Percy
python_311_percy:
docker:
- image: cimg/python:3.11-browsers
environment:
PERCY_ENABLED: True
PERCY_PROJECT: plotly/plotly.py
resource_class: large
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN_V0"' >> $BASH_ENV
- run:
name: Install requirements
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv sync --extra dev_optional
- run:
name: Build HTML figures (Pandas 2)
command: |
source .venv/bin/activate
python tests/percy/plotly-express.py
- run:
name: Build HTML figures (Pandas 1) and compare
command: |
source .venv/bin/activate
mkdir tests/percy/pandas2
mv tests/percy/*.html tests/percy/pandas2/
uv pip install pandas==1.5.3 numpy==1.26.4
python tests/percy/plotly-express.py
python tests/percy/compare-pandas.py
rm -rf tests/percy/pandas2
- run:
name: List installed packages and python version
command: |
source .venv/bin/activate
uv pip list
python --version
- run:
name: Run percy snapshots
command: |
npm i @percy/cli
npx percy snapshot -c tests/percy/snapshots.yml tests/percy/
rm tests/percy/*.html
plotlyjs_dev_build:
docker:
- image: cimg/python:3.12-node
environment:
LANG: en_US.UTF-8
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv sync --extra dev_optional
- run:
name: Update plotly.js to dev
command: |
source .venv/bin/activate
python commands.py updateplotlyjsdev
- run:
name: Test core
command: |
source .venv/bin/activate
locale
pytest -k 'not nodev' tests/test_core
no_output_timeout: 20m
- run:
name: Build source distribution packages
command: |
source .venv/bin/activate
uv sync --extra dev_build
python -m build --sdist --wheel -o dist
when: always
- store_artifacts:
path: dist/
full_build:
docker:
- image: cimg/python:3.12-node
environment:
LANG: en_US.UTF-8
resource_class: large
steps:
- checkout
- run:
name: PyPI Build
command: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate
uv sync --extra dev_build
cd js
npm ci
npm run build
cd ..
python -m build --sdist --wheel -o dist
cp -R dist output
git status
- run:
name: Zip output
command: |
tar czf output.tgz output
- store_artifacts:
path: output.tgz
workflows:
code_formatting:
jobs:
- check-code-formatting
dev_build:
jobs:
- plotlyjs_dev_build
release_build:
jobs:
- full_build
build:
jobs:
- test_core_py:
matrix:
parameters:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- test_optional_py:
matrix:
parameters:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- test_optional_py:
name: "test_optional_py-3.9_pandas-1.2.4"
python_version: "3.9"
pandas_version: "1.2.4"
numpy_version: "1.26.4"
- test_kaleido_v0:
matrix:
parameters:
python_version:
- "3.12"
- python_311_percy