Skip to content

Commit

Permalink
Fix #24 and update to 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sagitta1618 committed Jan 5, 2024
1 parent d42d9ed commit c786591
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/emagpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@author: jkl
"""
EMagPy_version = '1.3.0'
EMagPy_version = '1.3.1'
name = 'emagpy'
from emagpy.Problem import Problem
from emagpy.Survey import Survey
20 changes: 17 additions & 3 deletions src/ui-dir.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# this file is used by pyinstaller to generate a zip file that would
# then be uncompressed by the splashScreen.spec

import os
import glob

block_cipher = None

datas=[
Expand All @@ -17,8 +20,6 @@ datas=[

def extra_datas(mydir, outdir='emagpy'):
def rec_glob(p, files):
import os
import glob
for d in glob.glob(p):
if os.path.isfile(d):
files.append(d)
Expand All @@ -34,12 +35,25 @@ def extra_datas(mydir, outdir='emagpy'):
datas += extra_datas('examples')
datas += extra_datas('image', outdir='.')

# rasterio fix with pyinstaller
rdir = '../../pyenv/lib/site-packages/rasterio/'
rasterio_imports_paths = glob.glob(rdir + '*.py')
rasterio_imports = ['rasterio._shim']
for item in rasterio_imports_paths:
current_module_filename = os.path.split(item)[-1]
current_module_filename = 'rasterio.'+current_module_filename.replace('.py', '')
rasterio_imports.append(current_module_filename)

# the projection are stored in separate folders and also need to included
for d in ['gdal_data', 'proj_data']:
datas.append((os.path.join(rdir, d), os.path.join('rasterio', d)))
print(datas)

a = Analysis(['ui.py'],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=['pkg_resources.py2_warn'],
hiddenimports=['pkg_resources.py2_warn'] + rasterio_imports,#,'rasterio.sample', 'rasterio.vrt', 'rasterio.features'],
hookspath=[],
runtime_hooks=[],
excludes=[],
Expand Down

0 comments on commit c786591

Please sign in to comment.