Skip to content

Commit 15b260e

Browse files
committed
freezer: Install specific version of Pyinstaller. Add plain entry point file.
1 parent 9d68e5f commit 15b260e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

freezer/pyinstaller/entry_point.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import wpull.application.main
2+
3+
if __name__ == '__main__':
4+
wpull.application.main.main()

freezer/pyinstaller/runner.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def main():
1515
env_dir = os.path.abspath('./wpull_env/')
1616
is_windows = platform.system() == 'Windows'
1717
env_bin_dir = 'Scripts' if is_windows else 'bin'
18-
env_python_exe = 'python'
18+
env_python_exe = 'python.exe' if is_windows else 'python'
1919
exe_name = 'wpull'
2020
final_exe_name = 'wpull.exe' if is_windows else 'wpull'
2121

@@ -44,14 +44,15 @@ def run_env(args):
4444

4545
print('Check for PyInstaller.')
4646
try:
47-
run_env_py(['PyInstaller.main', '--version'])
48-
except subprocess.CalledProcessError as error:
49-
print('Returned code', error.returncode)
47+
run_env(['pyinstaller', '--version'])
48+
except (FileNotFoundError, subprocess.CalledProcessError) as error:
49+
if hasattr(error, 'returncode'):
50+
print('Returned code', error.returncode)
5051

5152
print('Install PyInstaller.')
5253
run_env_py([
5354
'pip', 'install',
54-
'PyInstaller',
55+
'PyInstaller==3.1.1',
5556
])
5657

5758
print('Install packages.')
@@ -65,7 +66,7 @@ def run_env(args):
6566

6667
print('Build binary.')
6768
run_env(['pyi-makespec',
68-
os.path.join(env_dir, env_bin_dir, 'wpull'),
69+
'entry_point.py',
6970
'--additional-hooks-dir', 'hooks',
7071
'--onefile',
7172
'--name', exe_name,

0 commit comments

Comments
 (0)