Skip to content
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

hooks: add hook for metpy #60

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/60.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``metpy``.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ iminuit==2.8.3
langdetect==1.0.9
mariadb==1.0.7; sys_platform != "darwin"
markdown==3.3.4
MetPy==1.1.0
mnemonic==0.20
msoffcrypto-tool==4.12.0
Office365-REST-Python-Client==2.3.8
Expand Down
21 changes: 21 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-metpy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------
# 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 copy_metadata, collect_data_files

# MetPy requires metadata, because it queries its version via
# pkg_resources.get_distribution(__package__).version or, in newer
# versions, importlib.metadata.version(__package__)
datas = copy_metadata('metpy')

# Collect data files
datas += collect_data_files('metpy')
8 changes: 8 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,3 +809,11 @@ def test_folium(pyi_builder):
import folium
m = folium.Map(location=[0, 0], zoom_start=5)
""")


@importorskip("metpy")
def test_metpy(pyi_builder):
# Import metpy.plots, which triggers search for colortables data.
pyi_builder.test_source("""
import metpy.plots
""")