Skip to content

Commit 15b0d20

Browse files
committed
Merge upstream.
1 parent 287ac36 commit 15b0d20

File tree

143 files changed

+9318
-3601
lines changed

Some content is hidden

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

143 files changed

+9318
-3601
lines changed

.appveyor.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
build: false
2+
3+
environment:
4+
matrix:
5+
- PYTHON: "C:\\Miniconda36-x64"
6+
PY: 3.7
7+
8+
init:
9+
- "ECHO %PYTHON_VERSION% %MINICONDA%"
10+
11+
install:
12+
# Install and configure miniconda.
13+
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
14+
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
15+
- conda update conda --quiet
16+
- conda config --add channels conda-forge --force
17+
- conda install pycryptosat
18+
- conda config --set safety_checks disabled
19+
20+
# Create the test env.
21+
- conda create --name TEST python=%PY% --file requirements.txt --file requirements-dev.txt
22+
- activate TEST
23+
24+
# Debug.
25+
- conda info --all
26+
- conda list
27+
28+
test_script:
29+
- pip install -e . --no-deps --force-reinstall
30+
- pytest -n 2 -rxXs tests

.github/CONTRIBUTING.md

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,47 @@ Whenever possible, please also include a [short, self-contained code example](ht
4444

4545
First of all, thanks for your interest in contributing!
4646

47-
- If you are new to git/Github, please take check a few tutorials
48-
on [git](https://git-scm.com/docs/gittutorial) and [GitHub](https://guides.github.com/).
49-
- The basic workflow for contributing is:
50-
1. [Fork](https://help.github.com/articles/fork-a-repo/) the repository
51-
2. [Clone](https://help.github.com/articles/cloning-a-repository/) the repository to create a local copy on your computer:
52-
```
53-
git clone [email protected]:${user}/folium.git
54-
cd folium
55-
```
56-
3. Create a branch for your changes
57-
```
58-
git checkout -b name-of-your-branch
59-
```
60-
4. Make change to your local copy of the folium repository
61-
5. Commit those changes
62-
```
63-
git add file1 file2 file3
64-
git commit -m 'a descriptive commit message'
65-
```
66-
6. Push your updated branch to your fork
67-
```
68-
git push origin name-of-your-branch
69-
```
70-
7. [Open a pull request](https://help.github.com/articles/creating-a-pull-request/) to the python-visualization/folium
47+
If you are new to git/Github, please take check a few tutorials
48+
on [git](https://git-scm.com/docs/gittutorial) and [GitHub](https://guides.github.com/).
49+
50+
The basic workflow for contributing is:
51+
52+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the repository
53+
2. [Clone](https://help.github.com/articles/cloning-a-repository/) the repository to create a local copy on your computer:
54+
```
55+
git clone [email protected]:${user}/folium.git
56+
cd folium
57+
```
58+
3. Create a branch for your changes
59+
```
60+
git checkout -b name-of-your-branch
61+
```
62+
4. Install the [miniconda](https://docs.conda.io/en/latest/miniconda.html) to avoid any external library errors.
63+
64+
If using `conda` one can create a development environment with:
65+
```
66+
$ conda create --name FOLIUM python=3.7 --file requirements.txt --file requirements-dev.txt
67+
```
68+
5. Install the dependencies listed in `requirements.txt` and `requirements-dev.txt`.
69+
```
70+
pip install -r requirements.txt
71+
pip install -r requirements-dev.txt
72+
```
73+
6. Install Firefox, download [geckodriver](https://github.com/mozilla/geckodriver/releases)
74+
and put it in the PATH.
75+
7. Make changes to your local copy of the folium repository
76+
8. Make sure the tests pass:
77+
* in the repository folder do `pip install -e . --no-deps` (needed for notebook tests)
78+
* run `python -m pytest tests`
79+
* run `flake8 folium --max-line-length=120`
80+
* resolve all errors
81+
9. Commit those changes
82+
```
83+
git add file1 file2 file3
84+
git commit -m 'a descriptive commit message'
85+
```
86+
10. Push your updated branch to your fork
87+
```
88+
git push origin name-of-your-branch
89+
```
90+
11. [Open a pull request](https://help.github.com/articles/creating-a-pull-request/) to the python-visualization/folium

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.egg-info/
2+
*.pyc
3+
.ipynb_checkpoints
4+
.pytest_cache
5+
build/
6+
dist/
7+
docs/_build/
8+
docs/quickstart.ipynb
9+
examples/results/*
10+
.cache/
11+
.idea/
12+
/*.xml
13+
/codestyles/*.xml
14+
/_mac/*.xml
15+
/inspection/*.xml
16+
geckodriver.log
17+
geckodriver.tar.gz
18+
geckodriver/
19+
miniconda.sh

.stickler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ linters:
22
flake8:
33
max-line-length: 120
44
max-complexity: 10
5+
python: 3
56
files:
67
ignore: ['*.ipynb', 'conf.py']

.travis.yml

Lines changed: 99 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,129 @@
1-
language: python
1+
language: minimal
22

33
sudo: false
44

5+
env:
6+
- MOZ_HEADLESS=1
7+
8+
addons:
9+
firefox: latest
10+
511
env:
612
global:
7-
- secure: "gRT413onDOvwgiHpNXRsiqo+ZZSjwwBpjZryQ9h6IqYw6cTN9YVivYF15uTMD//mZyFeHRz+F/7/0EG2z+UYIBKbgktiNMbie/KizwRBnCThGpcch1VeizkBkPluWSQXndXM6STkHvn0eZBZBBh0QdTm1qaI0babUmgZuWhrX38="
13+
- secure: "MTRxGE7N7I60vOk3f32NZjL2BLmP1H0W11HqfcbDO9IEN9Pb47mXQW6rNF0ZqOTt78kWtcHsR2non+nrLIjkglAb4psjUWOdQVh73y3JU4OrXqGCLssgIq9m6fMGOeFWvdektKG4v0TlnYwLhd6Lzes6eTrc+Z2UMHf4dZtuOPs="
814

915
matrix:
1016
fast_finish: true
1117
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
2230
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
2737

2838
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+
4158
4259
# Test source distribution.
4360
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
4562

4663
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 ;
4972
fi
5073

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 ;
5376
fi
5477

55-
- if [[ $TEST_TARGET == 'latest_branca' ]]; then
78+
- if [[ $TRAVIS_JOB_NAME == 'latest-branca' ]]; then
5679
conda uninstall branca ;
5780
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 ;
5988
fi
6089

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 ;
6492
fi
6593

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
69113
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 ;
75115
fi
76116

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

Comments
 (0)