Skip to content

Commit

Permalink
Remove .spec files from gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaarnio committed May 8, 2024
1 parent 2f71270 commit 8762d77
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec


# Installer logs
pip-log.txt
Expand Down
48 changes: 48 additions & 0 deletions building/eis_toolkit_binary.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import glob, os
from PyInstaller.utils.hooks import collect_dynamic_libs

rasterio_imports_paths = glob.glob(r'/home/niko/code/eis_toolkit_venv/lib/python3.10/site-packages/rasterio/*.py')
rasterio_imports = ['rasterio.sample']
rasterio_binaries = collect_dynamic_libs('rasterio')

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)

rasterio_imports.append('encodings')
rasterio_imports.append('encodings.*')

a = Analysis(
['../eis_toolkit/__main__.py'],
pathex=['/home/niko/code/eis_toolkit_venv/lib/python3.10/site-packages'],
binaries=rasterio_binaries,
datas=[],
hiddenimports=rasterio_imports,
hookspath=['./hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)

pyz = PYZ(a.pure, a.zipped_data)
exe = EXE(
pyz,
a.scripts,
a.binaries,
exclude_binaries=False,
name='eis_toolkit_binary',
debug=False, # Consider setting to False for production
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

52 changes: 52 additions & 0 deletions building/eis_toolkit_dir.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- mode: python ; coding: utf-8 -*-

import glob, os
rasterio_imports_paths = glob.glob(r'/home/niko/code/eis_toolkit_venv/lib/python3.10/site-packages/rasterio/*.py')
rasterio_imports = ['rasterio.sample']

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)

a = Analysis(
['../eis_toolkit/__main__.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=rasterio_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='eis_toolkit',
debug=True,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='eis_toolkit',
)

0 comments on commit 8762d77

Please sign in to comment.