Skip to content

Commit 5144385

Browse files
committed
Update spec files to work with pyinstaller 5.13.2
pyinstaller knows about astropy and scikit. Use pathlib for common directories
1 parent 304952a commit 5144385

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Dummy pyinstaller hook to avoid the 'workflow' hook in contrib.

planetary_system_stacker/planetary_system_stacker_linux.spec

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# -*- mode: python -*-
22

3-
block_cipher = None
3+
from pathlib import Path
44

5-
# Integrate astropy as data directory instead of module:
6-
import astropy
7-
astropy_path, = astropy.__path__
5+
block_cipher = None
6+
s_dir = Path('/home/castor/shares/castor/src/PlanetarySystemStacker')
87

98
a = Analysis(['planetary_system_stacker.py'],
10-
pathex=['/home/rolf/Pycharm-Projects/PlanetarySystemStacker/planetary_system_stacker'],
9+
pathex=[s_dir / 'planetary_system_stacker'],
1110
binaries=[],
12-
datas=[('/home/rolf/Pycharm-Projects/PlanetarySystemStacker/Documentation/Icon/PSS-Icon-64.jpg', '.' ),
13-
('/home/rolf/Pycharm-Projects/PlanetarySystemStacker/Documentation/PlanetarySystemStacker_User-Guide.pdf', '.' ),
14-
('/home/rolf/Pycharm-Projects/PlanetarySystemStacker/planetary_system_stacker/Videos/*', 'Videos' ),
15-
(astropy_path, 'astropy')],
16-
hiddenimports=['pywt._extensions._cwt', 'scipy._lib.messagestream', 'shelve', 'csv'], # The last two required by astropy
17-
hookspath=[],
11+
datas=[(s_dir / 'Documentation/Icon/PSS-Icon-64.jpg', '.' ),
12+
(s_dir / 'Documentation/PlanetarySystemStacker_User-Guide.pdf', '.' ),
13+
(s_dir / 'planetary_system_stacker/Videos/*', 'Videos' ),
14+
],
15+
hiddenimports=['pywt._extensions._cwt' ],
16+
hookspath=[s_dir / 'planetary_system_stacker/Pyinstaller_hooks'],
1817
runtime_hooks=[],
19-
excludes=['astropy'],
18+
excludes=[],
19+
# excludes=['astropy'],
2020
win_no_prefer_redirects=False,
2121
win_private_assemblies=False,
2222
cipher=block_cipher)

planetary_system_stacker/planetary_system_stacker_windows.spec

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@
22

33
block_cipher = None
44

5-
# Integrate astropy as data directory instead of module:
6-
import astropy
7-
astropy_path, = astropy.__path__
5+
from pathlib import Path
6+
7+
p_dir = Path(os.getenv('CONDA_PREFIX', 'C:\Python39'))
8+
s_dir = Path('D:\\SW-Development\\Python\\PlanetarySystemStacker')
9+
10+
print(s_dir,s_dir / 'planetary_system_stacker\Binaries\Api-ms-win-core-xstate-l2-1-0.dll')
811

912
a = Analysis(['planetary_system_stacker.py'],
10-
pathex=['D:\\SW-Development\\Python\\PlanetarySystemStacker\\planetary_system_stacker'],
11-
binaries=[('C:\Python39\Lib\site-packages\cv2\opencv_videoio_ffmpeg454_64.dll', '.'),
12-
('D:\SW-Development\Python\PlanetarySystemStacker\planetary_system_stacker\Binaries\Api-ms-win-core-xstate-l2-1-0.dll', '.'),
13-
('D:\SW-Development\Python\PlanetarySystemStacker\planetary_system_stacker\Binaries\Api-ms-win-crt-private-l1-1-0.dll', '.'),
13+
pathex=[s_dir / 'planetary_system_stacker'],
14+
binaries=[
15+
(s_dir / 'planetary_system_stacker\Binaries\Api-ms-win-core-xstate-l2-1-0.dll', '.'),
16+
(s_dir / 'planetary_system_stacker\Binaries\Api-ms-win-crt-private-l1-1-0.dll', '.'),
1417
('C:\Windows\System32\downlevel\API-MS-Win-Eventing-Provider-L1-1-0.dll', '.'),
15-
('D:\SW-Development\Python\PlanetarySystemStacker\planetary_system_stacker\Binaries\\api-ms-win-downlevel-shlwapi-l1-1-0.dll', '.')],
16-
datas=[( 'D:\\SW-Development\\Python\\PlanetarySystemStacker\\Documentation\\Icon\\PSS-Icon-64.ico', '.' ),
17-
( 'D:\\SW-Development\\Python\\PlanetarySystemStacker\\Documentation\\Icon\\PSS-Icon-64.png', '.' ),
18-
(astropy_path, 'astropy')],
19-
hiddenimports=['pywt._extensions._cwt', 'scipy._lib.messagestream', 'shelve', 'csv', 'pkg_resources.py2_warn'],
20-
hookspath=[],
18+
(s_dir / 'planetary_system_stacker\Binaries\\api-ms-win-downlevel-shlwapi-l1-1-0.dll', '.')],
19+
datas=[(s_dir / 'Documentation\\Icon\\PSS-Icon-64.ico', '.' ),
20+
(s_dir / 'Documentation\\Icon\\PSS-Icon-64.png', '.' ),
21+
],
22+
hiddenimports=['pywt._extensions._cwt', #'scipy._lib.messagestream', 'shelve', 'csv', 'pkg_resources.py2_warn'
23+
],
24+
hookspath=[s_dir / 'planetary_system_stacker\Pyinstaller_hooks'],
2125
runtime_hooks=[],
22-
excludes=['astropy'],
26+
excludes=[
27+
],
2328
win_no_prefer_redirects=False,
2429
win_private_assemblies=False,
2530
cipher=block_cipher,

0 commit comments

Comments
 (0)