diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a3dd497..ae763466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change log +### v0.15.3 +* Adds a `distribution` extra to install PyInstaller automatically. +* Updates the main Eel script to build using PyInstaller's Eel hook (https://github.com/pyinstaller/pyinstaller-hooks-contrib/pull/6). + ### v0.15.2 * Adds `register_eel_routes` to handle applying Eel routes to non-Bottle custom app instances. diff --git a/README.md b/README.md index 4ebc0a11..a0236e68 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ while True: 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**. 1. Configure a virtualenv with desired Python version and minimum necessary Python packages -2. Install PyInstaller `pip install PyInstaller` +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. 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`) 4. This will create a new folder `dist/` 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` diff --git a/eel/__main__.py b/eel/__main__.py index f5a81601..36721ce9 100644 --- a/eel/__main__.py +++ b/eel/__main__.py @@ -1,4 +1,3 @@ -import pkg_resources as pkg import PyInstaller.__main__ as pyi import os from argparse import ArgumentParser @@ -24,12 +23,9 @@ print("Building executable with main script '%s' and web folder '%s'...\n" % (main_script, web_folder)) -eel_js_file = pkg.resource_filename('eel', 'eel.js') -js_file_arg = '%s%seel' % (eel_js_file, os.pathsep) web_folder_arg = '%s%s%s' % (web_folder, os.pathsep, web_folder) -needed_args = ['--hidden-import', 'bottle_websocket', - '--add-data', js_file_arg, '--add-data', web_folder_arg] +needed_args = ['--add-data', web_folder_arg] full_args = [main_script] + needed_args + unknown_args print('Running:\npyinstaller', ' '.join(full_args), '\n') diff --git a/setup.py b/setup.py index ec65c93d..ce2dd93d 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='Eel', - version='0.15.2', + version='0.15.3', author='Python Eel Organisation', author_email='python-eel@protonmail.com', url='https://github.com/python-eel/Eel', @@ -16,6 +16,7 @@ }, install_requires=['bottle', 'bottle-websocket', 'future', 'pyparsing', 'whichcraft'], extras_require={ + "distribution": ['pyinstaller>=4.0.0,<6.0.0'], "jinja2": ['jinja2>=2.10'] }, python_requires='>=3.6',