Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

Commit 3f8d06c

Browse files
Off-load pyinstaller config to its hook
PyInstaller now has a custom hook for Eel (pyinstaller/pyinstaller-hooks-contrib#6) that tells it how to collect eel.js and our hidden imports (bottle-websocket), so we don't need our own code to enable this. We can also define a 'distribution' extra for Eel to additionally install PyInstaller for the user.
1 parent 5051761 commit 3f8d06c

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
### v0.15.3
4+
* Adds a `distribution` extra to install PyInstaller automatically.
5+
* Updates the main Eel script to build using PyInstaller's Eel hook (https://github.com/pyinstaller/pyinstaller-hooks-contrib/pull/6).
6+
37
### v0.15.2
48
* Adds `register_eel_routes` to handle applying Eel routes to non-Bottle custom app instances.
59

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ while True:
340340
If you want to package your app into a program that can be run on a computer without a Python interpreter installed, you should use **PyInstaller**.
341341

342342
1. Configure a virtualenv with desired Python version and minimum necessary Python packages
343-
2. Install PyInstaller `pip install PyInstaller`
343+
2. Install Eel with extra packages to simplify distribution `pip install eel[distribution]`. Eel currently uses [PyInstaller](https://www.pyinstaller.org/) to do the hard work.
344344
3. In your app's folder, run `python -m eel [your_main_script] [your_web_folder]` (for example, you might run `python -m eel hello.py web`)
345345
4. This will create a new folder `dist/`
346346
5. Valid PyInstaller flags can be passed through, such as excluding modules with the flag: `--exclude module_name`. For example, you might run `python -m eel file_access.py web --exclude win32com --exclude numpy --exclude cryptography`

eel/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pkg_resources as pkg
21
import PyInstaller.__main__ as pyi
32
import os
43
from argparse import ArgumentParser
@@ -24,12 +23,9 @@
2423
print("Building executable with main script '%s' and web folder '%s'...\n" %
2524
(main_script, web_folder))
2625

27-
eel_js_file = pkg.resource_filename('eel', 'eel.js')
28-
js_file_arg = '%s%seel' % (eel_js_file, os.pathsep)
2926
web_folder_arg = '%s%s%s' % (web_folder, os.pathsep, web_folder)
3027

31-
needed_args = ['--hidden-import', 'bottle_websocket',
32-
'--add-data', js_file_arg, '--add-data', web_folder_arg]
28+
needed_args = ['--add-data', web_folder_arg]
3329
full_args = [main_script] + needed_args + unknown_args
3430
print('Running:\npyinstaller', ' '.join(full_args), '\n')
3531

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
install_requires=['bottle', 'bottle-websocket', 'future', 'pyparsing', 'whichcraft'],
1818
extras_require={
19+
"distribution": ['pyinstaller>=4.0.0,<6.0.0'],
1920
"jinja2": ['jinja2>=2.10']
2021
},
2122
python_requires='>=3.6',

0 commit comments

Comments
 (0)