Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orca integration for static image export #1120

Merged
merged 82 commits into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9ffd55a
Experiments with orca and io module
jonmmease Aug 11, 2018
de10887
Added simple pyqt5 window backend
jonmmease Aug 11, 2018
38127fa
Added OrcaStatus singleton to hold status of orca server process
jonmmease Aug 11, 2018
fd32d64
More progress on the orca module.
jonmmease Aug 12, 2018
49130b1
Added update method to orca config object
jonmmease Aug 12, 2018
264d19b
Remove unused import
jonmmease Aug 12, 2018
9b6f8c8
Remove `autostart` and `hostname` configuration parameters
jonmmease Aug 13, 2018
8d31c9b
Docstrings and cleanup
jonmmease Aug 13, 2018
341d145
Kill the orca server process using psutil
jonmmease Aug 15, 2018
af10ff6
Don't auto import any of the show/backend logic
jonmmease Aug 15, 2018
eb21a70
auto import the plotly.io module
jonmmease Aug 15, 2018
0183d43
Capture server process output.
jonmmease Aug 15, 2018
f75652c
Merge branch 'master' into orca_integration
jonmmease Aug 18, 2018
fd3e65c
Initial Python 2 support
jonmmease Aug 18, 2018
15e62a0
Run orca auto-shutdown timer as daemon thread
jonmmease Aug 18, 2018
2d5a074
Added to_image tests against reference images
jonmmease Aug 18, 2018
2df38cc
Added image generation tests, converted orca server tests to use pytest
jonmmease Aug 18, 2018
68e6465
Point orca to packaged (offline) plotly.js and topojson and (online) …
jonmmease Aug 18, 2018
0d1e0eb
Add orca tests to 3.6 optional test suite
jonmmease Aug 19, 2018
f81e63c
Cannot install orca globally
jonmmease Aug 19, 2018
6f78063
Adds psutil dependency and try to add orca to path before running tox
jonmmease Aug 19, 2018
fc35eff
Forgot && in tox command
jonmmease Aug 19, 2018
48d4de5
Try global install of orca in tox environment
jonmmease Aug 19, 2018
88b293a
Local install in tox
jonmmease Aug 19, 2018
86fc540
Tox whitelist export command
jonmmease Aug 19, 2018
702dd59
whitelist ls and echo
jonmmease Aug 19, 2018
196b58b
Set extend PATH in tox setenv block
jonmmease Aug 19, 2018
2f08714
If search for orca fails, try orca.js. Also display search path
jonmmease Aug 19, 2018
2217628
Changing course. Try creating a conda environment
jonmmease Aug 19, 2018
a6a255a
Attempt to cache miniconda directory
jonmmease Aug 19, 2018
e8bc4eb
Activate conda environment through separate command
jonmmease Aug 19, 2018
1207e71
Make plotlyjs bundle read only
jonmmease Aug 19, 2018
7d3e244
Echo path in command. Why isn't pytest on the path?
jonmmease Aug 19, 2018
6fc596c
Remove debugging assertion
jonmmease Aug 19, 2018
bfd7ff8
Try to set environment variables in single block with tests
jonmmease Aug 19, 2018
b212564
Add nose and mock dependencies
jonmmease Aug 19, 2018
dc7cf36
disable warning in case this was causing exit code 2 failure
jonmmease Aug 19, 2018
192953b
Comment out optional tests for now.
jonmmease Aug 20, 2018
0a756f4
Don't shut down orca server during test image tests
jonmmease Aug 20, 2018
d29da80
Fix python specification (need ==)
jonmmease Aug 20, 2018
8ce2115
Removed dependency version constraints (something was forcing python …
jonmmease Aug 20, 2018
7a75478
FileNotFoundError not available on Python 2
jonmmease Aug 20, 2018
42be57e
Install all main repo dependencies in one command
jonmmease Aug 20, 2018
d213f86
Store failed image comparisons as artifacts
jonmmease Aug 20, 2018
3a73dfc
Remove geopandas for the moment, causing version conflict
jonmmease Aug 20, 2018
f9b0133
Update orca version constraints test
jonmmease Aug 20, 2018
62583c9
Try to make reference images more reproducible
jonmmease Aug 20, 2018
1830594
Try `python` as invalid executable for test
jonmmease Aug 20, 2018
4ce674d
Use separate reference images for Mac and Linux
jonmmease Aug 20, 2018
a50a5bf
Reinstate save/load settings with a few changes since last time:
jonmmease Aug 20, 2018
2c42fca
Don't run optional tests in orca workflow, just core and orca.
jonmmease Aug 20, 2018
37dcf76
Change cache key to include python version
jonmmease Aug 20, 2018
f30e247
Added back decorator dependency
jonmmease Aug 20, 2018
80f52c7
Added back pandas dependency
jonmmease Aug 20, 2018
6bfca05
Hide warnings from core tests
jonmmease Aug 20, 2018
c9d5832
Test orca on Python 2.7, 3.4, and 3.7
jonmmease Aug 20, 2018
79f89e1
Change 3.4 to 3.5 work around conda package dependency issues
jonmmease Aug 20, 2018
f44aea3
Fix workflow name
jonmmease Aug 20, 2018
32630a1
Single equals in conda python version specification
jonmmease Aug 20, 2018
aacc203
Reinstate all test workflows
jonmmease Aug 20, 2018
133cb24
Remove `orca` from the name of the functions in `plotly.io.orca`.
jonmmease Aug 22, 2018
1fa866b
Reorder properties in `config` and `status` repr to be a bit more log…
jonmmease Aug 22, 2018
cff8f1c
Merge branch 'master' into orca_integration
jonmmease Aug 22, 2018
9c70b3a
Add validate option to to_image and write_image
jonmmease Aug 22, 2018
8d97381
Added more helpful (at least friendlier) error message when plotly.py…
jonmmease Aug 23, 2018
c58d688
Add poppler dependency to circle conda environment
jonmmease Aug 23, 2018
8967568
Create failed directory and print failed image path
jonmmease Aug 23, 2018
c5dd2f3
Fix store_artifacts directory
jonmmease Aug 23, 2018
dab4e14
Update EPS images for CircleCI
jonmmease Aug 23, 2018
3137b0c
Re-enable all tests
jonmmease Aug 23, 2018
005299f
Extend time for orca startup to help CI robustness
jonmmease Aug 23, 2018
5f8b813
Remove explicit encoding when opening orca settings for Python 2 compat
jonmmease Aug 23, 2018
94c1bab
Fix executable version check error messages
jonmmease Aug 24, 2018
2b4fc0c
Make orca executable detection more specific.
jonmmease Aug 24, 2018
54d38d4
Python 2 test fix [ci skip]
jonmmease Aug 24, 2018
f38beb5
Use status.executable when building the orca command.
jonmmease Aug 24, 2018
e383c57
Use os.pathset so we don't mess up Windows paths
jonmmease Aug 24, 2018
88b37a0
Add helpful message when orca returns a 'plotly.js error' on mapbox
jonmmease Aug 25, 2018
0a0adac
Removed prototype plotly.io._show module.
jonmmease Aug 25, 2018
f37682f
revert tox changes (not using tox to test orca after all)
jonmmease Aug 25, 2018
d8958aa
Remove topojson from packagedata (not distributing it after all)
jonmmease Aug 25, 2018
25f1f81
Full PR review
jonmmease Aug 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,96 @@ jobs:
command: 'tox -e py37-plot_ly'
no_output_timeout: 20m

"python-2-7-orca":
docker:
- image: circleci/node:10.9-stretch-browsers
environment:
PYTHON_VERSION: 2.7

steps:
- checkout
- restore_cache:
keys:
- conda-27-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
- run:
name: Create conda environment
command: .circleci/create_conda_optional_env.sh

- save_cache:
key: conda-27-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
paths:
- /home/circleci/miniconda/
- run:
name: Run Tests
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed

"python-3-5-orca":
docker:
- image: circleci/node:10.9-stretch-browsers
environment:
PYTHON_VERSION: 3.5

steps:
- checkout
- restore_cache:
keys:
- conda-35-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
- run:
name: Create conda environment
command: .circleci/create_conda_optional_env.sh

- save_cache:
key: conda-35-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
paths:
- /home/circleci/miniconda/
- run:
name: Run Tests
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed

"python-3-7-orca":
docker:
- image: circleci/node:10.9-stretch-browsers
environment:
PYTHON_VERSION: 3.7

steps:
- checkout
- restore_cache:
keys:
- conda-37-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
- run:
name: Create conda environment
command: .circleci/create_conda_optional_env.sh

- save_cache:
key: conda-37-v1-{{ checksum ".circleci/create_conda_optional_env.sh" }}
paths:
- /home/circleci/miniconda/
- run:
name: Run Tests
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed

workflows:
version: 2
build:
Expand All @@ -250,3 +340,6 @@ workflows:
- "python-2.7-plot_ly"
- "python-3.4-plot_ly"
- "python-3.7-plot_ly"
- "python-2-7-orca"
- "python-3-5-orca"
- "python-3-7-orca"
23 changes: 23 additions & 0 deletions .circleci/create_conda_optional_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
# Download miniconda
if [ "$PYTHON_VERSION" = "2.7" ]; then
wget http://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh
else
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
fi

chmod +x miniconda.sh

# Install miniconda
./miniconda.sh -b -p $HOME/miniconda

# Create environment
# PYTHON_VERSION=3.6
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
requests six pytz retrying psutil pandas decorator pytest mock nose poppler

# Install orca into environment
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ venv
build
dist
plotly.egg-info/

plotly/tests/test_orca/images/*/failed
plotly/tests/test_orca/images/*/tmp
2 changes: 1 addition & 1 deletion js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions optional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ numpy
coverage==4.3.1
mock==2.0.0
nose==1.3.3
pytest==3.5.1

## orca ##
psutil

## codegen dependencies ##
yapf
Expand All @@ -37,5 +41,5 @@ pyshp
geopandas
shapely

# ipyplotly integration
pil
# image uri conversion
pillow
2 changes: 1 addition & 1 deletion plotly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
from __future__ import absolute_import

from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,
utils, session, offline, colors)
utils, session, offline, colors, io)
from plotly.version import __version__
2 changes: 2 additions & 0 deletions plotly/io/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from ._orca import to_image, write_image
from . import orca
Loading