-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathconfig.yml
584 lines (541 loc) · 16.7 KB
/
config.yml
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
version: 2.1
orbs:
browser-tools: circleci/[email protected]
commands:
test_core:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
cd packages/python/plotly
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_<<parameters.py>>_core.txt
- run:
name: Test core
command: |
cd packages/python/plotly
. venv/bin/activate
pytest plotly/tests/test_core
no_output_timeout: 20m
test_optional:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
cd packages/python/plotly
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
- run:
name: Install plotly-geo
command: |
cd packages/python/plotly-geo
. ../plotly/venv/bin/activate
pip install -e .
- run:
name: Test core
command: |
cd packages/python/plotly
. venv/bin/activate
pytest plotly/tests/test_core
no_output_timeout: 20m
- run:
name: Test optional
command: |
cd packages/python/plotly
. venv/bin/activate
pytest plotly/tests/test_optional
no_output_timeout: 40m
- run:
name: Test utils
command: |
cd packages/python/plotly
. venv/bin/activate
pytest _plotly_utils/tests/
no_output_timeout: 20m
- run:
name: Test io
command: |
cd packages/python/plotly
. venv/bin/activate
pytest plotly/tests/test_io
no_output_timeout: 20m
- run:
name: Test dependencdies not imported
command: |
cd packages/python/plotly
. venv/bin/activate
pytest -x test_init/test_dependencies_not_imported.py
- run:
name: Test lazy imports
command: |
cd packages/python/plotly
. venv/bin/activate
pytest -x test_init/test_lazy_imports.py
test_orca:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: Install dependencies
command: |
cd packages/python/plotly
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_<<parameters.py>>_optional.txt
- run:
name: Install plotly-geo
command: |
cd packages/python/plotly-geo
. ../plotly/venv/bin/activate
pip install -e .
- run:
name: Install orca
command: |
npm install [email protected]
npm install orca
sudo apt-get update
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV
- run:
name: Test orca
command: |
cd packages/python/plotly
. venv/bin/activate
pytest plotly/tests/test_orca
no_output_timeout: 20m
- store_artifacts:
path: packages/python/plotly/plotly/tests/test_orca/images/linux/failed
jobs:
check-code-formatting:
docker:
- image: cimg/python:3.7
steps:
- checkout
- run:
name: Install black
command: |
python -m venv venv
. venv/bin/activate
pip install black==22.3.0
- run:
name: Check formatting with black
command: |
. venv/bin/activate
black --check . --exclude venv
# Core
python_36_core:
docker:
- image: cimg/python:3.6-browsers
steps:
- test_core:
py: "36"
python_37_core:
docker:
- image: cimg/python:3.7-browsers
steps:
- test_core:
py: "37"
python_38_core:
docker:
- image: cimg/python:3.8-browsers
steps:
- test_core:
py: "38"
python_39_core:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_core:
py: "39"
# Optional
python_36_optional:
docker:
- image: cimg/python:3.6-browsers
steps:
- test_optional:
py: "36"
python_37_optional:
docker:
- image: cimg/python:3.7-browsers
steps:
- test_optional:
py: "37"
python_38_optional:
docker:
- image: cimg/python:3.8-browsers
steps:
- test_optional:
py: "38"
python_39_optional:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_optional:
py: "39"
# Pandas
python_39_pandas_2_optional:
docker:
- image: cimg/python:3.9-browsers
steps:
- test_optional:
py: "39_pandas_2"
# Orca
python_38_orca:
docker:
- image: cimg/python:3.8-browsers
steps:
- test_orca:
py: "38"
# Percy
python_37_percy:
docker:
- image: cimg/python:3.9-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: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -e ./packages/python/plotly
pip install -e ./packages/python/plotly-geo
pip install -r ./packages/python/plotly/test_requirements/requirements_39_pandas_2_optional.txt
- run:
name: Build html figures (Pandas 2)
command: |
. venv/bin/activate
python test/percy/plotly-express.py
- run:
name: Build html figures (Pandas 1) and compare
command: |
. venv/bin/activate
mkdir test/percy/pandas2
mv test/percy/*.html test/percy/pandas2/
# 1.1 is the earliest minor with Py3.9 wheels
pip install "pandas==1.1.5"
python test/percy/plotly-express.py
python test/percy/compare-pandas.py
rm -rf test/percy/pandas2
- run:
name: Run percy snapshots
command: |
npm i @percy/cli
npx percy snapshot -c test/percy/snapshots.yml test/percy/
rm test/percy/*.html
# Chart studio
python_37_chart_studio:
docker:
- image: cimg/python:3.7
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: |
cd packages/python/chart-studio
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_37.txt
- run:
name: Tests
command: |
cd packages/python/chart-studio
. venv/bin/activate
pytest -x chart_studio/tests/
no_output_timeout: 20m
plotlyjs_dev_build:
docker:
- image: cimg/python:3.7-node
environment:
LANG: en_US.UTF-8
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: |
cd packages/python/plotly
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_37_core.txt black inflect
pip install jupyterlab~=3.0
- run:
name: Update jupyterlab-plotly version
command: |
cd packages/python/plotly
. venv/bin/activate
python setup.py updateplotlywidgetversion
- run:
name: Update plotly.js to dev
command: |
cd packages/python/plotly
. venv/bin/activate
python setup.py updateplotlyjsdev
- run:
name: Test core
command: |
cd packages/python/plotly
. venv/bin/activate
locale
pytest -k 'not nodev' plotly/tests/test_core
no_output_timeout: 20m
- run:
name: Commit
command: |
cd packages/python/plotly
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git add -A
git commit -m "Codegen"
when: always
- run:
name: Build source distribution packages
command: |
cd packages/python/plotly
. venv/bin/activate
python setup.py sdist
when: always
- store_artifacts:
path: packages/python/plotly/dist
full_build:
docker:
- image: continuumio/miniconda3
environment:
LANG: en_US.UTF-8
resource_class: large
steps:
- checkout
- run:
name: Create conda environment
command: |
conda create -n env --yes python=3.9 conda-build conda-verify
conda install -n env -c conda-forge jupyterlab=3 nodejs=16
conda init bash
mkdir output
- run:
name: initial NPM Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
cd packages/javascript/jupyterlab-plotly
npm ci
npm run build:prod
git status
- run:
name: PyPI Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
cd packages/python/plotly
python setup.py sdist bdist_wheel
cp -R dist ../../../output/dist
git status
- run:
name: Conda Build
command: |
eval "$(conda shell.bash hook)"
conda activate env
cd packages/python/plotly
conda build recipe/
mv /opt/conda/envs/env/conda-bld/noarch/plotly*.tar.bz2 ../../../output
git status
- run:
name: NPM Pack
command: |
eval "$(conda shell.bash hook)"
conda activate env
cd packages/javascript/jupyterlab-plotly
npm pack
mv jupyterlab-plotly*.tgz ../../../output
- run:
name: Zip output
command: |
tar czf output.tgz output
- run:
name: Git Diff
command: |
git status
git diff
- store_artifacts:
path: output.tgz
build-doc:
resource_class: xlarge
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, for example, `3.6.1-browsers`
- image: cimg/python:3.7-browsers
steps:
- add_ssh_keys:
fingerprints:
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
- checkout
# Download and cache dependencies
- restore_cache:
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- run:
name: install dependencies
command: |
cd doc
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip uninstall -y plotly
pip install -r requirements.txt
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
pip uninstall -y plotly
pip install -e ../packages/python/plotly
fi
cd ..
- run:
name: Install orca
command: |
npm install [email protected]
npm install orca
sudo apt-get update
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
echo 'export PATH="/home/circleci/project/node_modules/.bin:$PATH"' >> $BASH_ENV
- save_cache:
paths:
- ./doc/venv
- ./doc/node_modules
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}-{{ checksum ".circleci/config.yml" }}
- run:
name: make html
command: |
cd doc
. venv/bin/activate
echo ${mapbox_token} > python/.mapbox_token
make -kj8 || make -kj8
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/check-or-enforce-order.py > check-or-enforce-order.py
python front-matter-ci.py build/html
python check-or-enforce-order.py build/html
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
cd build/html
git init
git config user.name plotlydocbot
git config user.email [email protected]
git add *
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push --force [email protected]:plotly/plotly.py-docs.git master:built
rm -rf .git
cd ../..
cd build/ipynb
git init
git config user.name plotlydocbot
git config user.email [email protected]
git add *
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push --force [email protected]:plotly/plotly.py-docs.git master:built_ipynb
rm -rf .git
cd ../..
fi
tar -zcf build/html.tgz build/html
rm -rf build/html build/ipynb
cd ..
- run:
name: trigger doc build
command: |
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
git clone --depth=1 https://github.com/plotly/graphing-library-docs.git
cd graphing-library-docs
git config user.name plotlydocbot
git config user.email [email protected]
git commit --allow-empty -m "deploying https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push
cd ..
rm -rf graphing-library-docs
fi
- run:
name: make doc
command: |
cd doc
. venv/bin/activate
# For the API doc, we need to use the local version of plotly
# since we are tweaking the source because of
# graph_objs/graph_objects
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
pip uninstall -y plotly
cd ../packages/python/plotly
pip install -e .
cd ../../../doc
cd apidoc
make html
cd _build/html
touch .nojekyll
git init
git config user.name plotlydocbot
git config user.email [email protected]
git add *
git add .nojekyll
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
git push --force [email protected]:plotly/plotly.py-docs.git master:gh-pages
rm -rf .git
cd ../..
fi
- store_artifacts:
path: doc/build
destination: doc/build
workflows:
code_formatting:
jobs:
- check-code-formatting
dev_build:
jobs:
- plotlyjs_dev_build
release_build:
jobs:
- full_build
build:
jobs:
- python_36_core
- python_37_core
- python_38_core
- python_39_core
- python_36_optional
- python_37_optional
- python_38_optional
- python_39_optional
- python_39_pandas_2_optional
- python_38_orca
- python_37_percy
- build-doc