Skip to content

Commit

Permalink
hooks: fiona: update for compatibility with fiona 1.9.0
Browse files Browse the repository at this point in the history
Add `fiona.enums` to the hidden imports; the import is made in
cythonized `fiona.crs` module.
  • Loading branch information
rokm committed Jan 31, 2023
1 parent 88366af commit aced500
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/541.update.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update ``fiona`` hook for compatibility with ``fiona`` 1.9.0.
2 changes: 1 addition & 1 deletion requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dash-uploader==0.6.0
# We install it via apt-get and brew on ubuntu and macOS CI runners, respectively.
discid==1.2.0; sys_platform != 'win32'
fabric==3.0.0
fiona==1.8.22; sys_platform != 'win32'
fiona==1.9.0; sys_platform != 'win32'
folium==0.14.0
ffpyplayer==4.3.5; python_version < '3.10' # doesn't have py310 wheels
geopandas==0.12.2; python_version >= '3.8' and sys_platform != 'win32'
Expand Down
7 changes: 5 additions & 2 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fiona.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_data_files

from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies

hiddenimports = [
"fiona._shim",
"fiona.schema",
"json",
]

# As of fiona 1.9.0, `fiona.enums` is also a hidden import, made in cythonized `fiona.crs`.
if is_module_satisfies("fiona >= 1.9.0"):
hiddenimports.append("fiona.enums")

# Collect data files that are part of the package (e.g., projections database)
datas = collect_data_files("fiona")

0 comments on commit aced500

Please sign in to comment.