Skip to content

Commit 982a8d2

Browse files
authored
Merge pull request #5 from plotly/master
Sync Fork from Upstream Repo
2 parents 7136685 + 0753196 commit 982a8d2

File tree

392 files changed

+68433
-38205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+68433
-38205
lines changed

.circleci/config.yml

Lines changed: 148 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
- checkout
1010
- run:
1111
name: Install black
12-
command: 'sudo pip install black'
12+
command: "sudo pip install black"
1313
- run:
1414
name: Check formatting with black
15-
command: 'black --check .'
15+
command: "black --check ."
1616

1717
# Core
1818
python-2.7-core:
@@ -25,10 +25,10 @@ jobs:
2525
- checkout
2626
- run:
2727
name: Install tox
28-
command: 'sudo pip install tox'
28+
command: "sudo pip install tox"
2929
- run:
3030
name: Test with tox
31-
command: 'cd packages/python/plotly; tox -e py27-core'
31+
command: "cd packages/python/plotly; tox -e py27-core"
3232
no_output_timeout: 20m
3333

3434
python-3.5-core:
@@ -41,10 +41,10 @@ jobs:
4141
- checkout
4242
- run:
4343
name: Install tox
44-
command: 'sudo pip install tox'
44+
command: "sudo pip install tox"
4545
- run:
4646
name: Test with tox
47-
command: 'cd packages/python/plotly; tox -e py35-core'
47+
command: "cd packages/python/plotly; tox -e py35-core"
4848
no_output_timeout: 20m
4949

5050
python-3.6-core:
@@ -57,10 +57,10 @@ jobs:
5757
- checkout
5858
- run:
5959
name: Install tox
60-
command: 'sudo pip install tox'
60+
command: "sudo pip install tox"
6161
- run:
6262
name: Test with tox
63-
command: 'cd packages/python/plotly; tox -e py36-core'
63+
command: "cd packages/python/plotly; tox -e py36-core"
6464
no_output_timeout: 20m
6565

6666
python-3.7-core:
@@ -73,10 +73,10 @@ jobs:
7373
- checkout
7474
- run:
7575
name: Install tox
76-
command: 'sudo pip install tox'
76+
command: "sudo pip install tox"
7777
- run:
7878
name: Test with tox
79-
command: 'cd packages/python/plotly; tox -e py37-core'
79+
command: "cd packages/python/plotly; tox -e py37-core"
8080
no_output_timeout: 20m
8181

8282
python-3.7-percy:
@@ -122,14 +122,10 @@ jobs:
122122
- checkout
123123
- run:
124124
name: Install tox
125-
command: 'sudo pip install tox'
126-
- run:
127-
name: Install npm dependencies
128-
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
129-
no_output_timeout: 20m
125+
command: "sudo pip install tox"
130126
- run:
131127
name: Test with tox
132-
command: 'cd packages/python/plotly; tox -e py27-optional'
128+
command: "cd packages/python/plotly; tox -e py27-optional"
133129
no_output_timeout: 20m
134130

135131
python-3.5-optional:
@@ -142,14 +138,10 @@ jobs:
142138
- checkout
143139
- run:
144140
name: Install tox
145-
command: 'sudo pip install tox'
146-
- run:
147-
name: Install npm dependencies
148-
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
149-
no_output_timeout: 20m
141+
command: "sudo pip install tox"
150142
- run:
151143
name: Test with tox
152-
command: 'cd packages/python/plotly; tox -e py35-optional'
144+
command: "cd packages/python/plotly; tox -e py35-optional"
153145
no_output_timeout: 20m
154146

155147
python-3.6-optional:
@@ -162,14 +154,10 @@ jobs:
162154
- checkout
163155
- run:
164156
name: Install tox
165-
command: 'sudo pip install tox'
166-
- run:
167-
name: Install npm dependencies
168-
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
169-
no_output_timeout: 20m
157+
command: "sudo pip install tox"
170158
- run:
171159
name: Test with tox
172-
command: 'cd packages/python/plotly; tox -e py36-optional'
160+
command: "cd packages/python/plotly; tox -e py36-optional"
173161
no_output_timeout: 20m
174162

175163
python-3.7-optional:
@@ -182,14 +170,10 @@ jobs:
182170
- checkout
183171
- run:
184172
name: Install tox
185-
command: 'sudo pip install tox'
186-
- run:
187-
name: Install npm dependencies
188-
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
189-
no_output_timeout: 20m
173+
command: "sudo pip install tox"
190174
- run:
191175
name: Test with tox
192-
command: 'cd packages/python/plotly; tox -e py37-optional'
176+
command: "cd packages/python/plotly; tox -e py37-optional"
193177
no_output_timeout: 20m
194178

195179
# Plot.ly
@@ -203,10 +187,10 @@ jobs:
203187
- checkout
204188
- run:
205189
name: Install tox
206-
command: 'sudo pip install tox'
190+
command: "sudo pip install tox"
207191
- run:
208192
name: Test with tox
209-
command: 'cd packages/python/chart-studio; tox -e py27-plot_ly'
193+
command: "cd packages/python/chart-studio; tox -e py27-plot_ly"
210194
no_output_timeout: 20m
211195

212196
python-3.5-plot_ly:
@@ -219,10 +203,10 @@ jobs:
219203
- checkout
220204
- run:
221205
name: Install tox
222-
command: 'sudo pip install tox'
206+
command: "sudo pip install tox"
223207
- run:
224208
name: Test with tox
225-
command: 'cd packages/python/chart-studio; tox -e py35-plot_ly'
209+
command: "cd packages/python/chart-studio; tox -e py35-plot_ly"
226210
no_output_timeout: 20m
227211

228212
python-3.7-plot_ly:
@@ -235,10 +219,10 @@ jobs:
235219
- checkout
236220
- run:
237221
name: Install tox
238-
command: 'sudo pip install tox'
222+
command: "sudo pip install tox"
239223
- run:
240224
name: Test with tox
241-
command: 'cd packages/python/chart-studio; tox -e py37-plot_ly'
225+
command: "cd packages/python/chart-studio; tox -e py37-plot_ly"
242226
no_output_timeout: 20m
243227

244228
python-2-7-orca:
@@ -269,7 +253,7 @@ jobs:
269253
pytest packages/python/plotly/plotly/tests/test_orca
270254
271255
- store_artifacts:
272-
path: plotly/tests/test_orca/images/linux/failed
256+
path: plotly/tests/test_orca/images/linux/failed
273257

274258
python-3-5-orca:
275259
docker:
@@ -299,7 +283,7 @@ jobs:
299283
pytest packages/python/plotly/plotly/tests/test_orca
300284
301285
- store_artifacts:
302-
path: plotly/tests/test_orca/images/linux/failed
286+
path: plotly/tests/test_orca/images/linux/failed
303287

304288
python-3-7-orca:
305289
docker:
@@ -325,11 +309,12 @@ jobs:
325309
command: |
326310
. /home/circleci/miniconda/etc/profile.d/conda.sh
327311
conda activate circle_optional
312+
pytest --doctest-modules --ignore packages/python/plotly/plotly/tests --ignore packages/python/plotly/plotly/matplotlylib/mplexporter/tests packages/python/plotly/plotly
328313
pytest --disable-warnings packages/python/plotly/plotly/tests/test_core
329314
pytest packages/python/plotly/plotly/tests/test_orca
330315
331316
- store_artifacts:
332-
path: plotly/tests/test_orca/images/linux/failed
317+
path: plotly/tests/test_orca/images/linux/failed
333318

334319
plotlyjs_dev_build:
335320
docker:
@@ -342,13 +327,13 @@ jobs:
342327
- checkout
343328
- run:
344329
name: Install tox
345-
command: 'sudo pip install retrying tox black inflect'
330+
command: "sudo pip install retrying tox black inflect"
346331
- run:
347332
name: Update jupyterlab-plotly version
348-
command: 'cd packages/python/plotly; python setup.py updateplotlywidgetversion'
333+
command: "cd packages/python/plotly; python setup.py updateplotlywidgetversion"
349334
- run:
350335
name: Update plotly.js to dev
351-
command: 'cd packages/python/plotly; python setup.py updateplotlyjsdev'
336+
command: "cd packages/python/plotly; python setup.py updateplotlyjsdev"
352337
- run:
353338
name: Test with tox
354339
command: |
@@ -384,6 +369,122 @@ jobs:
384369
- store_artifacts:
385370
path: packages/python/plotly/dist
386371

372+
build-doc:
373+
resource_class: xlarge
374+
docker:
375+
# specify the version you desire here
376+
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
377+
- image: circleci/python:3.6.8-node
378+
379+
working_directory: ~/project
380+
381+
steps:
382+
- add_ssh_keys:
383+
fingerprints:
384+
- "dc:5f:39:48:00:b4:72:34:e1:d2:c4:e1:1f:d1:e2:ce" #plotlydocbot
385+
386+
- checkout
387+
388+
# Download and cache dependencies
389+
- restore_cache:
390+
keys:
391+
- v1-dependencies-{{ checksum "doc/requirements.txt" }}
392+
# fallback to using the latest cache if no exact match is found
393+
- v1-dependencies-
394+
395+
- run:
396+
name: install dependencies
397+
command: |
398+
cd doc
399+
python3 -m venv venv
400+
. venv/bin/activate
401+
npm install [email protected]
402+
npm install orca
403+
pip uninstall -y plotly
404+
pip install -r requirements.txt
405+
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
406+
pip uninstall -y plotly
407+
cd ../packages/python/plotly
408+
python3 setup.py install
409+
cd ../../../doc
410+
fi
411+
echo 'export PATH="/home/circleci/project/doc/node_modules/.bin:$PATH"' >> $BASH_ENV
412+
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2
413+
cd ..
414+
415+
- save_cache:
416+
paths:
417+
- ./doc/venv
418+
- ./doc/node_modules
419+
key: v1-dependencies-{{ checksum "doc/requirements.txt" }}
420+
421+
- run:
422+
name: make html
423+
command: |
424+
cd doc
425+
. venv/bin/activate
426+
echo ${mapbox_token} > python/.mapbox_token
427+
make -kj8 || make -kj8
428+
curl https://raw.githubusercontent.com/plotly/documentation/source-design-merge/front-matter-ci.py > front-matter-ci.py
429+
curl https://raw.githubusercontent.com/plotly/documentation/source-design-merge/check-or-enforce-order.py > check-or-enforce-order.py
430+
python front-matter-ci.py build/html
431+
python check-or-enforce-order.py build/html
432+
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
433+
cd build/html
434+
git init
435+
git config user.name plotlydocbot
436+
git config user.email [email protected]
437+
git add *
438+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
439+
git push --force [email protected]:plotly/plotly.py-docs.git master:built
440+
rm -rf .git
441+
cd ../..
442+
fi
443+
tar -zcf build/html.tgz build/html
444+
rm -rf build/html build/ipynb
445+
cd ..
446+
447+
- run:
448+
name: trigger doc build
449+
command: |
450+
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
451+
git clone --depth=1 --branch=source-design-merge https://github.com/plotly/documentation.git
452+
cd documentation
453+
git config user.name plotlydocbot
454+
git config user.email [email protected]
455+
git commit --allow-empty -m "deploying https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
456+
git push
457+
cd ..
458+
rm -rf documentation
459+
fi
460+
461+
- run:
462+
name: make doc
463+
command: |
464+
cd doc
465+
. venv/bin/activate
466+
cd apidoc
467+
make html
468+
if [ "${CIRCLE_BRANCH}" == "doc-prod" ]; then
469+
cd _build/html
470+
touch .nojekyll
471+
git init
472+
git config user.name plotlydocbot
473+
git config user.email [email protected]
474+
git add *
475+
git add .nojekyll
476+
git commit -m "build of https://github.com/plotly/plotly.py/commit/${CIRCLE_SHA1}"
477+
git push --force [email protected]:plotly/plotly.py-docs.git master:gh-pages
478+
rm -rf .git
479+
cd ../..
480+
fi
481+
482+
cd ../..
483+
484+
- store_artifacts:
485+
path: doc/build
486+
destination: doc/build
487+
387488
workflows:
388489
version: 2
389490
code_formatting:
@@ -412,3 +513,4 @@ workflows:
412513
- python-2-7-orca
413514
- python-3-5-orca
414515
- python-3-7-orca
516+
- build-doc

.circleci/create_conda_optional_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
1616
# Create environment
1717
# PYTHON_VERSION=3.6
1818
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
19-
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython
19+
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython jupyter ipykernel ipywidgets
2020

2121
# Install orca into environment
2222
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ plotly/tests/test_orca/images/*/tmp
4343
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
4444
temp-plot.html
4545
.vscode
46+
doc/python/.ipynb_checkpoints
47+
doc/python/.mapbox_token
48+
doc/.ipynb_checkpoints

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)