Skip to content

Commit

Permalink
hooks: add hook for folium (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
rokm committed Sep 10, 2021
1 parent bf4c4d7 commit d9d75d5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/62.new.rst
@@ -0,0 +1 @@
Add hook for ``folium``.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Expand Up @@ -9,6 +9,7 @@ cloudscraper==1.2.58
dash==2.0.0
dash-bootstrap-components==0.13.0
dash-uploader==0.5.0
folium==0.12.1
h5py==3.4.0; python_version >= '3.7'
humanize==3.11.0
iminuit==2.8.3
Expand Down
16 changes: 16 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-folium.py
@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_data_files

# Collect data files (templates)
datas = collect_data_files("folium")
8 changes: 8 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Expand Up @@ -801,3 +801,11 @@ def test_branca(pyi_builder):
pyi_builder.test_source("""
import branca
""")


@importorskip("folium")
def test_folium(pyi_builder):
pyi_builder.test_source("""
import folium
m = folium.Map(location=[0, 0], zoom_start=5)
""")

0 comments on commit d9d75d5

Please sign in to comment.