-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathcircle.yml
86 lines (65 loc) · 2.91 KB
/
circle.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
machine:
pre:
- cd /home/ubuntu/.pyenv/plugins/python-build/../.. && git pull && cd -
- pyenv install 3.6.4
environment:
PLOTLY_CONFIG_DIR: ${HOME}/.plotly
TOX_TESTENV_PASSENV: PLOTLY_TOX_*
PLOTLY_TOX_PYTHON_27: /home/ubuntu/.pyenv/versions/2.7.10/bin/python2.7
PLOTLY_TOX_PYTHON_33: /home/ubuntu/.pyenv/versions/3.3.3/bin/python3.3
PLOTLY_TOX_PYTHON_34: /home/ubuntu/.pyenv/versions/3.4.3/bin/python3.4
PLOTLY_TOX_PYTHON_35: /home/ubuntu/.pyenv/versions/3.5.0/bin/python3.5
PLOTLY_TOX_PYTHON_36: /home/ubuntu/.pyenv/versions/3.6.4/bin/python3.6
PLOTLY_JUPYTER_TEST_DIR: /home/ubuntu/${CIRCLE_PROJECT_REPONAME}/plotly/tests/test_optional/test_jupyter
node:
# use a pre-installed version of node so we don't need to download it.
version: 6.11.1
dependencies:
override:
# Temporary workaround
- mv plotly/graph_objs/graph_objs.py plotly/graph_objs/graph_objs_temp.py
- touch plotly/graph_objs/graph_objs.py
- mv plotly/graph_objs/graph_objs_temp.py plotly/graph_objs/graph_objs.py
# install everything tox knows about and the plotly package.
- pyenv local 3.6.4
- pip install -e .
- pip install tox
- tox --notest
- python setup.py codegen
- pip install -I .
- jupyter nbextension enable --py widgetsnbextension
- jupyter nbextension install --py --symlink --sys-prefix plotlywidget
- jupyter nbextension enable --py --sys-prefix plotlywidget
# we need to cd out of the project root to ensure the install worked
- cd ~ && python -c "import plotly"
# install jupyter test JS requirements
# - cd ${PLOTLY_JUPYTER_TEST_DIR} && npm i
cache_directories:
# cache everything that tox installs for us.
- .tox
- ${PLOTLY_JUPYTER_TEST_DIR}/node_modules
test:
override:
# let tox do its thing. matplotlib is broken at the moment.
- tox -- -a '!matplotlib'
# we setup tox to create coverage reports, move them to artifacts.
- mv ~/${CIRCLE_PROJECT_REPONAME}/.tox/coverage-reports ${CIRCLE_ARTIFACTS}
# import it once normally (ensures .plotly exists)
- python -c "import plotly"
# test that it imports when you don't have write permissions
- sudo chmod -R 444 ${PLOTLY_CONFIG_DIR} && python -c "import plotly"
# test that giving back write permissions works again
- sudo chmod -R 777 ${PLOTLY_CONFIG_DIR} && python -c "import plotly"
# test that figure_factory cannot be imported with only core requirements.
# since optional requirements is part of the test suite, we don't need to
# worry about testing that it *can* be imported in this case.
- $(! python -c "import plotly.figure_factory")
# test the distribution and a basic import
- rm -rf dist/ &&
python setup.py sdist &&
mkdir test_install &&
cd test_install &&
virtualenv venv &&
source venv/bin/activate &&
pip install ../dist/* &&
python -c "import plotly"