diff --git a/news/541.update.1.rst b/news/541.update.1.rst new file mode 100644 index 00000000..bba9c77d --- /dev/null +++ b/news/541.update.1.rst @@ -0,0 +1 @@ +Update ``fiona`` hook for compatibility with ``fiona`` 1.9.0. diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 7f31a12b..f3e766cb 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -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' diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fiona.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fiona.py index 3e7a1bef..7dcbef52 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fiona.py +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-fiona.py @@ -10,8 +10,7 @@ # 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", @@ -19,5 +18,9 @@ "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")