-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathconfig.yml
476 lines (435 loc) · 14.2 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
version: 2.1
commands:
test_core:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- run:
name: Install dependencies
command: "cd packages/python; sudo pip install -r ./plotly/test_requirements/requirements_<<parameters.py>>_core.txt"
- run:
name: Test core
command: "cd packages/python/plotly; pytest plotly/tests/test_core"
no_output_timeout: 20m
test_optional:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- run:
name: Install dependencies
command: "cd packages/python; sudo pip install -r ./plotly/test_requirements/requirements_<<parameters.py>>_optional.txt"
- run:
name: Install plotly-geo
command: "cd packages/python/plotly-geo; sudo pip install -e ."
- run:
name: Test core
command: "cd packages/python/plotly; pytest plotly/tests/test_core"
no_output_timeout: 20m
- run:
name: Test optional
command: "cd packages/python/plotly; pytest plotly/tests/test_optional"
no_output_timeout: 40m
- run:
name: Test utils
command: "cd packages/python/plotly; pytest _plotly_utils/tests/"
no_output_timeout: 20m
- run:
name: Test io
command: "cd packages/python/plotly; pytest plotly/tests/test_io"
no_output_timeout: 20m
- run:
name: Test dependencdies not imported
command: "cd packages/python/plotly; pytest -x test_init/test_dependencies_not_imported.py"
- run:
name: Test lazy imports
command: "cd packages/python/plotly; pytest -x test_init/test_lazy_imports.py"
test_orca:
parameters:
py:
default: "36"
type: string
steps:
- checkout
- run:
name: Install dependencies
command: "cd packages/python; sudo pip install -r ./plotly/test_requirements/requirements_<<parameters.py>>_optional.txt"
- run:
name: Install plotly-geo
command: "cd packages/python/plotly-geo; sudo pip install -e ."
- run:
name: Install orca
command: |
sudo npm install [email protected] sudo npm install orca
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; 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: circleci/python:3.7-stretch-node-browsers
steps:
- checkout
- run:
name: Install black
command: "sudo pip install black==22.3.0"
- run:
name: Check formatting with black
command: "black --check ."
# Core
python_36_core:
docker:
- image: circleci/python:3.6-stretch-node-browsers
steps:
- test_core:
py: "36"
python_37_core:
docker:
- image: circleci/python:3.7-stretch-node-browsers
steps:
- test_core:
py: "37"
python_38_core:
docker:
- image: circleci/python:3.8-buster-node-browsers
steps:
- test_core:
py: "38"
python_39_core:
docker:
- image: circleci/python:3.9-buster-node-browsers
steps:
- test_core:
py: "39"
# Optional
python_36_optional:
docker:
- image: circleci/python:3.6-stretch-node-browsers
steps:
- test_optional:
py: "36"
python_37_optional:
docker:
- image: circleci/python:3.7-stretch-node-browsers
steps:
- test_optional:
py: "37"
python_38_optional:
docker:
- image: circleci/python:3.8-buster-node-browsers
steps:
- test_optional:
py: "38"
python_39_optional:
docker:
- image: circleci/python:3.9-buster-node-browsers
steps:
- test_optional:
py: "39"
# Orca
python_38_orca:
docker:
- image: circleci/python:3.8-buster-node-browsers
steps:
- test_orca:
py: "38"
# Percy
python_37_percy:
docker:
- image: circleci/python:3.7-stretch-node-browsers
environment:
PERCY_ENABLED: True
PERCY_PROJECT: plotly/plotly.py
resource_class: large
steps:
- checkout
- run:
name: Inject Percy Environment variables
command: |
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN_V0"' >> $BASH_ENV
- run:
name: Install requirements
command: |
sudo pip install --upgrade virtualenv
python -m venv venv || virtualenv venv
. venv/bin/activate
pip install -e ./packages/python/plotly
pip install -e ./packages/python/plotly-geo
pip install -r ./packages/python/plotly/test_requirements/requirements_37_optional.txt
- run:
name: Build html figures
command: |
. venv/bin/activate
python test/percy/plotly-express.py
- run:
name: Run percy snapshots
command: |
npm i @percy/cli
npx percy snapshot test/percy/
rm test/percy/*.html
# Chart studio
python_37_chart_studio:
docker:
- image: circleci/python:3.7-stretch-node-browsers
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: "cd packages/python; sudo pip install -r ./chart-studio/test_requirements/requirements_37.txt"
- run:
name: Tests
command: "cd packages/python/chart-studio; pytest -x chart_studio/tests/"
no_output_timeout: 20m
plotlyjs_dev_build:
docker:
- image: circleci/python:3.7-stretch-node-browsers
environment:
LANG: en_US.UTF-8
resource_class: large
steps:
- checkout
- run:
name: Install dependencies
command: "cd packages/python; sudo pip install -r ./plotly/test_requirements/requirements_37_core.txt black inflect; sudo pip install jupyterlab~=3.0"
- run:
name: Update jupyterlab-plotly version
command: "cd packages/python/plotly; python setup.py updateplotlywidgetversion"
- run:
name: Update plotly.js to dev
command: "cd packages/python/plotly; python setup.py updateplotlyjsdev"
- run:
name: Test core
command: "cd packages/python/plotly; 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
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 nodejs=12
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, e.g. `3.6.1-browsers`
- image: circleci/python:3.7-stretch-node-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:
keys:
- v1-dependencies-{{ checksum "doc/requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: install dependencies
command: |
cd doc
python3 -m venv venv
. venv/bin/activate
npm install [email protected]
npm install orca
pip install -U pip
pip uninstall -y plotly
pip install -r requirements.txt
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
pip uninstall -y plotly
cd ../packages/python/plotly
pip install -e .
cd ../../../doc
fi
echo 'export PATH="/home/circleci/project/doc/node_modules/.bin:$PATH"' >> $BASH_ENV
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
cd ..
- save_cache:
paths:
- ./doc/venv
- ./doc/node_modules
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}
- 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_38_orca
- python_37_percy
- python_37_chart_studio
- build-doc