main.spec 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # -*- mode: python ; coding: utf-8 -*-
  2. import glob, os
  3. rasterio_imports_paths1 = glob.glob(r'D:\tool\anaconda\envs\shuihuan\Lib\site-packages\rasterio\*.py')
  4. rasterio_imports_paths2 = glob.glob(r'D:\tool\anaconda\envs\shuihuan\Lib\site-packages\rasterio\*.pyd')
  5. hidden_imports = [
  6. 'fiona._shim',
  7. 'fiona.schema',
  8. 'rasterio._shim',
  9. 'rasterio.sample',
  10. 'numpy',
  11. ]
  12. for item in rasterio_imports_paths1:
  13. current_module_filename = os.path.split(item)[-1]
  14. current_module_filename = 'rasterio.'+current_module_filename.replace('.py', '')
  15. hidden_imports.append(current_module_filename)
  16. for item in rasterio_imports_paths2:
  17. current_module_filename = os.path.split(item)[-1]
  18. current_module_filename = 'rasterio.'+current_module_filename.replace('.pyd', '')
  19. current_module_filename = current_module_filename.split('.')[0] + '.' + current_module_filename.split('.')[1]
  20. hidden_imports.append(current_module_filename)
  21. block_cipher = None
  22. a = Analysis(
  23. ['main.py'],
  24. pathex=[],
  25. binaries=[],
  26. datas=[],
  27. hiddenimports=hidden_imports,
  28. hookspath=[],
  29. hooksconfig={},
  30. runtime_hooks=[],
  31. excludes=[],
  32. win_no_prefer_redirects=False,
  33. win_private_assemblies=False,
  34. cipher=block_cipher,
  35. noarchive=False,
  36. )
  37. pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
  38. exe = EXE(
  39. pyz,
  40. a.scripts,
  41. [],
  42. exclude_binaries=True,
  43. name='main',
  44. debug=False,
  45. bootloader_ignore_signals=False,
  46. strip=False,
  47. upx=False,
  48. console=True,
  49. disable_windowed_traceback=False,
  50. argv_emulation=False,
  51. target_arch=None,
  52. codesign_identity=None,
  53. entitlements_file=None,
  54. )
  55. coll = COLLECT(
  56. exe,
  57. a.binaries,
  58. a.zipfiles,
  59. a.datas,
  60. strip=False,
  61. upx=True,
  62. upx_exclude=[],
  63. name='main',
  64. )