diff --git a/news/693.update.rst b/news/693.update.rst new file mode 100644 index 00000000..5ccc1afa --- /dev/null +++ b/news/693.update.rst @@ -0,0 +1 @@ + Fix hook for ``osgeo``, to include proj data files. diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-osgeo.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-osgeo.py index 93ec328c..70315a67 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-osgeo.py +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-osgeo.py @@ -39,8 +39,8 @@ # Auxiliary data: # -# - general case (data in 'osgeo/data/gdal'): -datas = collect_data_files('osgeo', subdir=os.path.join('data', 'gdal')) +# - general case (data in 'osgeo/data'): +datas = collect_data_files('osgeo', subdir='data') # check if the data has been effectively found in 'osgeo/data/gdal' if len(datas) == 0: diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index 8ed8a83c..c886969b 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -1895,3 +1895,12 @@ def test_pypylon(pyi_builder): pyi_builder.test_source(""" from pypylon import pylon """) + +@importorskip('osgeo') +def test_osgeo(pyi_builder): + pyi_builder.test_source(""" + from osgeo import osr + sr = osr.SpatialReference() + sr.ImportFromEPSG(4326) + assert(sr.EPSGTreatsAsLatLong()) + """) \ No newline at end of file