|
1 |
| -language: python |
| 1 | +language: minimal |
2 | 2 |
|
3 | 3 | sudo: false
|
4 | 4 |
|
| 5 | +env: |
| 6 | + - MOZ_HEADLESS=1 |
| 7 | + |
| 8 | +addons: |
| 9 | + firefox: latest |
| 10 | + |
5 | 11 | env:
|
6 | 12 | global:
|
7 |
| - - secure: "gRT413onDOvwgiHpNXRsiqo+ZZSjwwBpjZryQ9h6IqYw6cTN9YVivYF15uTMD//mZyFeHRz+F/7/0EG2z+UYIBKbgktiNMbie/KizwRBnCThGpcch1VeizkBkPluWSQXndXM6STkHvn0eZBZBBh0QdTm1qaI0babUmgZuWhrX38=" |
| 13 | + - secure: "MTRxGE7N7I60vOk3f32NZjL2BLmP1H0W11HqfcbDO9IEN9Pb47mXQW6rNF0ZqOTt78kWtcHsR2non+nrLIjkglAb4psjUWOdQVh73y3JU4OrXqGCLssgIq9m6fMGOeFWvdektKG4v0TlnYwLhd6Lzes6eTrc+Z2UMHf4dZtuOPs=" |
8 | 14 |
|
9 | 15 | matrix:
|
10 | 16 | fast_finish: true
|
11 | 17 | include:
|
12 |
| - - python: 2.7 |
13 |
| - env: TEST_TARGET=default |
14 |
| - - python: 3.6 |
15 |
| - env: TEST_TARGET=default |
16 |
| - - python: 3.6 |
17 |
| - env: TEST_TARGET=notebooks |
18 |
| - - python: 3.6 |
19 |
| - env: TEST_TARGET=latest_branca |
20 |
| - - python: 3.6 |
21 |
| - env: TEST_TARGET=docs |
| 18 | + - name: default |
| 19 | + env: PY=3.7 |
| 20 | + - name: notebooks-conding-standard |
| 21 | + env: PY=3.7 |
| 22 | + - name: notebooks-code |
| 23 | + env: PY=3.7 |
| 24 | + - name: latest-branca |
| 25 | + env: PY=3.7 |
| 26 | + - name: docs |
| 27 | + env: PY=3.7 |
| 28 | + - name: "tarball" |
| 29 | + env: PY=3.7 |
22 | 30 | allow_failures:
|
23 |
| - - python: 2.7 |
24 |
| - env: TEST_TARGET=latest_branca |
25 |
| - - python: 3.6 |
26 |
| - env: TEST_TARGET=latest_branca |
| 31 | + - name: latest-branca |
| 32 | + env: PY=3.7 |
| 33 | + - name: linkcheck |
| 34 | + env: PY=3.7 |
| 35 | + - name: notebooks-conding-standard |
| 36 | + env: PY=3.7 |
27 | 37 |
|
28 | 38 | before_install:
|
29 |
| - - wget http://bit.ly/miniconda -O miniconda.sh |
30 |
| - - bash miniconda.sh -b -p $HOME/miniconda |
31 |
| - - export PATH="$HOME/miniconda/bin:$PATH" |
32 |
| - - conda config --set always_yes yes --set changeps1 no --set show_channel_urls true |
33 |
| - - conda update conda |
34 |
| - - conda config --add channels conda-forge --force |
35 |
| - - conda create --name TEST python=$TRAVIS_PYTHON_VERSION phantomjs --file requirements.txt --file requirements-dev.txt |
36 |
| - - source activate TEST |
37 |
| - |
38 |
| - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then |
39 |
| - conda install mock ; |
40 |
| - fi |
| 39 | + # Install miniconda and create TEST env. |
| 40 | + - | |
| 41 | + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh |
| 42 | + bash miniconda.sh -b -p $HOME/miniconda |
| 43 | + export PATH="$HOME/miniconda/bin:$PATH" |
| 44 | + conda config --set always_yes yes --set changeps1 no --set show_channel_urls true |
| 45 | + conda update conda --quiet |
| 46 | + conda config --add channels conda-forge --force |
| 47 | + conda config --set channel_priority strict |
| 48 | + conda config --set safety_checks disabled |
| 49 | + conda create --name TEST python=$PY --file requirements.txt --file requirements-dev.txt |
| 50 | + source activate TEST |
| 51 | + # Install firefox headless driver. |
| 52 | + - | |
| 53 | + wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz -O geckodriver.tar.gz |
| 54 | + mkdir geckodriver |
| 55 | + tar -xzf geckodriver.tar.gz -C geckodriver |
| 56 | + export PATH=$PATH:$PWD/geckodriver |
| 57 | +
|
41 | 58 |
|
42 | 59 | # Test source distribution.
|
43 | 60 | install:
|
44 |
| - - python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install folium-${version}.tar.gz && popd |
| 61 | + - pip install -e . --no-deps --force-reinstall |
45 | 62 |
|
46 | 63 | script:
|
47 |
| - - if [[ $TEST_TARGET != 'docs' ]]; then |
48 |
| - cp -r tests/ examples/ /tmp && cd /tmp ; |
| 64 | + - if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then |
| 65 | + pip wheel . -w dist --no-deps ; |
| 66 | + check-manifest --verbose ; |
| 67 | + twine check dist/* ; |
| 68 | + fi |
| 69 | + |
| 70 | + - if [[ $TRAVIS_JOB_NAME != 'docs' ]]; then |
| 71 | + cp -r tests/ examples/ /tmp ; |
49 | 72 | fi
|
50 | 73 |
|
51 |
| - - if [[ $TEST_TARGET == 'default' ]]; then |
52 |
| - py.test -vv --ignore=tests/notebooks/test_notebooks.py ; |
| 74 | + - if [[ $TRAVIS_JOB_NAME == 'default' ]]; then |
| 75 | + pytest /tmp -vv --ignore=tests/notebooks/test_notebooks.py ; |
53 | 76 | fi
|
54 | 77 |
|
55 |
| - - if [[ $TEST_TARGET == 'latest_branca' ]]; then |
| 78 | + - if [[ $TRAVIS_JOB_NAME == 'latest-branca' ]]; then |
56 | 79 | conda uninstall branca ;
|
57 | 80 | pip install git+https://github.com/python-visualization/branca.git ;
|
58 |
| - py.test -vv --ignore=tests/notebooks/test_notebooks.py ; |
| 81 | + pytest /tmp -vv --ignore=tests/notebooks/test_notebooks.py ; |
| 82 | + fi |
| 83 | + |
| 84 | + - if [[ $TRAVIS_JOB_NAME == 'notebooks-conding-standard' ]]; then |
| 85 | + for NB in $(find . -type f -name "*.ipynb"); |
| 86 | + do jupyter nbconvert --template=tests/strip_markdown.tpl --stdout --to python "${NB}" | flake8 - --ignore=W391,E226,E402,,W504,I100,I201,I202 --max-line-length=120 --show-source ; |
| 87 | + done ; |
59 | 88 | fi
|
60 | 89 |
|
61 |
| - - if [[ $TEST_TARGET == 'notebooks' ]]; then |
62 |
| - for file in $(find . -type f -name "*.ipynb"); do jupyter nbconvert --template=tests/strip_markdown.tpl --stdout --to python $file | grep -v '^get_ipython' | flake8 - --ignore=W391,E226,E402,I100 --max-line-length=100 --show-source ; done ; |
63 |
| - py.test -vv tests/notebooks/test_notebooks.py ; |
| 90 | + - if [[ $TRAVIS_JOB_NAME == 'notebooks-code' ]]; then |
| 91 | + pytest --nbval-lax /tmp/examples ; |
64 | 92 | fi
|
65 | 93 |
|
66 |
| - - if [[ $TEST_TARGET == 'docs' ]]; then |
67 |
| - set -e ; |
68 |
| - conda install doctr ; |
| 94 | +# Docs |
| 95 | + - | |
| 96 | + if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then |
| 97 | + set -e |
| 98 | + conda install doctr |
| 99 | + cp examples/Quickstart.ipynb docs/quickstart.ipynb |
| 100 | + pushd docs |
| 101 | + make clean html |
| 102 | + popd |
| 103 | + if [[ -z "$TRAVIS_TAG" ]]; then |
| 104 | + python -m doctr deploy --build-tags --key-path github_deploy_key_python_visualization_folium.enc --built-docs docs/_build/html/ dev |
| 105 | + else |
| 106 | + python -m doctr deploy --build-tags --key-path github_deploy_key_python_visualization_folium.enc --built-docs docs/_build/html/ "version-$TRAVIS_TAG" |
| 107 | + python -m doctr deploy --build-tags --key-path github_deploy_key_python_visualization_folium.enc --built-docs docs/_build/html/ . |
| 108 | + fi |
| 109 | + fi |
| 110 | +
|
| 111 | +
|
| 112 | + - if [[ $TRAVIS_JOB_NAME == 'linkcheck' ]]; then |
69 | 113 | cp examples/Quickstart.ipynb docs/quickstart.ipynb ;
|
70 |
| - pushd docs ; |
71 |
| - make clean html linkcheck ; |
72 |
| - popd ; |
73 |
| - python -m doctr deploy --sync .; |
74 |
| - python -m doctr deploy --sync --no-require-master --built-docs docs/_build/html "docs-$TRAVIS_BRANCH" ; |
| 114 | + pushd docs && make clean html linkcheck && popd ; |
75 | 115 | fi
|
76 | 116 |
|
77 |
| -doctr: |
78 |
| - require-master: true |
79 |
| - sync: False |
| 117 | +deploy: |
| 118 | + skip_cleanup: true |
| 119 | + provider: pypi |
| 120 | + user: ocefpaf |
| 121 | + password: |
| 122 | + secure: "BdJc76Z+DnmmamZSX+QCGZDnf+FW/JQOnVZ2t59r2r2RM4860Wf6GSL/Ncw6v8G3sOghWQcMzFdY5e6aNzAW0Ddm2YKHAsfxgurbEsnlzwsNPBWv2280ca7TtlFk2JkqhtYQOkoBFbA8+e/lC8ZC6aAVffQAT1NE4lEs0/Jd+TA=" |
| 123 | + distributions: sdist bdist_wheel |
| 124 | + upload_docs: no |
| 125 | + on: |
| 126 | + repo: python-visualization/folium |
| 127 | + tags: true |
| 128 | + all_branches: master |
| 129 | + condition: '$TRAVIS_JOB_NAME == "default"' |
0 commit comments