-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use firefox headless instead of phantomjs #1015
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
Merged
ocefpaf
merged 7 commits into
python-visualization:master
from
ocefpaf:firefox_headless
Nov 20, 2018
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2e3470f
use firefox headless
ocefpaf 21adc3e
minor fixes
ocefpaf 3b3bf76
gitignore geckodriver logs
Conengmo 8ba1ca6
review actions
ocefpaf ad997a2
guide on installing requirements, running flake8
Conengmo f7840ee
fix tests for latest pytest
ocefpaf 86f87c2
fix lints
ocefpaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,32 +44,37 @@ Whenever possible, please also include a [short, self-contained code example](ht | |
|
||
First of all, thanks for your interest in contributing! | ||
|
||
- If you are new to git/Github, please take check a few tutorials | ||
on [git](https://git-scm.com/docs/gittutorial) and [GitHub](https://guides.github.com/). | ||
- The basic workflow for contributing is: | ||
1. [Fork](https://help.github.com/articles/fork-a-repo/) the repository | ||
2. [Clone](https://help.github.com/articles/cloning-a-repository/) the repository to create a local copy on your computer: | ||
``` | ||
git clone [email protected]:${user}/folium.git | ||
cd folium | ||
``` | ||
3. Create a branch for your changes | ||
``` | ||
git checkout -b name-of-your-branch | ||
``` | ||
4. Make change to your local copy of the folium repository | ||
5. Make sure the tests pass: | ||
* in the repository folder do `pip install -e .` (needed for notebook tests) | ||
* along with all the dependencies install `phantomjs` via `npm install -g phantomjs` or by downloading it from [here](http://phantomjs.org/download.html) and installing manually | ||
* run `python -m pytest tests` | ||
* resolve all errors | ||
6. Commit those changes | ||
``` | ||
git add file1 file2 file3 | ||
git commit -m 'a descriptive commit message' | ||
``` | ||
7. Push your updated branch to your fork | ||
``` | ||
git push origin name-of-your-branch | ||
``` | ||
8. [Open a pull request](https://help.github.com/articles/creating-a-pull-request/) to the python-visualization/folium | ||
If you are new to git/Github, please take check a few tutorials | ||
on [git](https://git-scm.com/docs/gittutorial) and [GitHub](https://guides.github.com/). | ||
|
||
The basic workflow for contributing is: | ||
|
||
1. [Fork](https://help.github.com/articles/fork-a-repo/) the repository | ||
2. [Clone](https://help.github.com/articles/cloning-a-repository/) the repository to create a local copy on your computer: | ||
``` | ||
git clone [email protected]:${user}/folium.git | ||
cd folium | ||
``` | ||
3. Create a branch for your changes | ||
``` | ||
git checkout -b name-of-your-branch | ||
``` | ||
4. Install the dependencies listed in `requirements.txt` and `requirements-dev.txt`. | ||
5. Install Firefox, download [geckodriver](https://github.com/mozilla/geckodriver/releases) | ||
and put it in the PATH. | ||
6. Make changes to your local copy of the folium repository | ||
7. Make sure the tests pass: | ||
* in the repository folder do `pip install -e .` (needed for notebook tests) | ||
* run `python -m pytest tests` | ||
* run `flake8 folium --max-line-length=120` | ||
* resolve all errors | ||
8. Commit those changes | ||
``` | ||
git add file1 file2 file3 | ||
git commit -m 'a descriptive commit message' | ||
``` | ||
9. Push your updated branch to your fork | ||
``` | ||
git push origin name-of-your-branch | ||
``` | ||
10. [Open a pull request](https://help.github.com/articles/creating-a-pull-request/) to the python-visualization/folium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ examples/results/* | |
/codestyles/*.xml | ||
/_mac/*.xml | ||
/inspection/*.xml | ||
geckodriver.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
|
||
from __future__ import (absolute_import, division, print_function) | ||
|
||
import sys | ||
import io | ||
import sys | ||
|
||
import PIL.Image | ||
|
||
|
@@ -19,18 +19,22 @@ | |
|
||
|
||
@pytest.fixture | ||
def make_map(png_enabled=False): | ||
m = folium.Map(png_enabled=png_enabled) | ||
return m | ||
def m(): | ||
yield folium.Map(png_enabled=False) | ||
|
||
|
||
@pytest.fixture | ||
def m_png(): | ||
yield folium.Map(png_enabled=True) | ||
|
||
|
||
def test__repr_html_is_str(): | ||
html = make_map()._repr_html_() | ||
def test__repr_html_is_str(m): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E302 expected 2 blank lines, found 1 |
||
html = m._repr_html_() | ||
assert isinstance(html, str) | ||
|
||
|
||
def test_valid_html(): | ||
html = make_map()._repr_html_() | ||
def test_valid_html(m): | ||
html = m._repr_html_() | ||
parts = html.split('><') | ||
assert len(parts) == 6 | ||
assert parts[0].lstrip('<div ') == 'style="width:100%;"' | ||
|
@@ -41,19 +45,19 @@ def test_valid_html(): | |
assert parts[5] == '/div>' | ||
|
||
|
||
def test__repr_png_no_image(): | ||
png = make_map(png_enabled=False)._repr_png_() | ||
def test__repr_png_no_image(m): | ||
png = m._repr_png_() | ||
assert png is None | ||
|
||
|
||
def test__repr_png_is_bytes(): | ||
png = make_map(png_enabled=True)._repr_png_() | ||
def test__repr_png_is_bytes(m_png): | ||
png = m_png._repr_png_() | ||
assert isinstance(png, bytes) | ||
|
||
|
||
@pytest.mark.skipif(sys.version_info < (3, 0), | ||
reason="Doesn't work on Python 2.7.") | ||
def test_valid_png(): | ||
png = make_map(png_enabled=True)._repr_png_() | ||
def test_valid_png(m_png): | ||
png = m_png._repr_png_() | ||
img = PIL.Image.open(io.BytesIO(png)) | ||
isinstance(img, PIL.PngImagePlugin.PngImageFile) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.