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: pyproj: collect metadata for pyproj >= 3.4.0 #505

Merged
merged 1 commit into from
Nov 7, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions news/505.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ``pyproj`` hook for compatibility with ``pyproj`` v3.4.0.
2 changes: 1 addition & 1 deletion requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fabric==2.7.1
fiona==1.8.22; sys_platform != 'win32'
folium==0.13.0
ffpyplayer==4.3.5; python_version < '3.10' # doesn't have py310 wheels
geopandas==0.11.1; python_version >= '3.8' and sys_platform != 'win32'
geopandas==0.12.1; python_version >= '3.8' and sys_platform != 'win32'
python-gitlab==3.11.0
h5py==3.7.0; python_version >= '3.7'
humanize==4.4.0
Expand Down
7 changes: 6 additions & 1 deletion src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pyproj.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import os
import sys
from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies
from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies, copy_metadata
from PyInstaller.compat import is_win


Expand Down Expand Up @@ -56,3 +56,8 @@
from PyInstaller.utils.hooks import logger
logger.warning("Datas for pyproj not found at:\n{}".format(src_proj_data))
# A runtime hook defines the path for `PROJ_LIB`

# With pyproj 3.4.0, we need to collect package's metadata due to `importlib.metadata.version(__package__)` call in
# `__init__.py`. This change was reverted in subsequent releases of pyproj, so we collect metadata only for 3.4.0.
if is_module_satisfies("pyproj == 3.4.0"):
datas += copy_metadata("pyproj")