Repository: pyinstaller/pyinstaller

Issue:
Hook for webassets (include filters)
I am currently working on a [pywebview](https://github.com/r0x0r/pywebview) app that uses Flask for the webframework. 
When it comes to Flask, I've been developing the frontend using the webassets module with [Flask-Assets](https://flask-assets.readthedocs.io/en/latest/) that uses **filters** to pack Javascript and CSS.
I've tried using pyinstaller to freeze the app in a executable, but instead I am getting the following error:
```
Traceback (most recent call last):
  File "run.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "gui\__init__.py", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "gui\assets_registor.py", line 3, in <module>
  File "webassets\bundle.py", line 115, in __init__
  File "webassets\bundle.py", line 173, in _set_filters
  File "webassets\bundle.py", line 173, in <listcomp>
  File "webassets\filter\__init__.py", line 625, in get_filter
ValueError: No filter 'jsmin'
[7756] Failed to execute script run
```
Even tho, looking inside the `site-packages` folder I can see jsmin and cssmin. Any idea what is causing to the executable don't find them?


Discussion:
This looks like not all required files are packages. Look at webassets\filter\__init__.py line 625 to learn how the filter are searched. Then have a look at [Make sure everything is packaged correctly](https://github.com/pyinstaller/pyinstaller/wiki/How-to-Report-Bugs#make-sure-everything-is-packaged-correctly) for tips to find out what is missing.

We would appreciate if you'd submit a hook for this. See https://pyinstaller.readthedocs.org/en/latest/hooks.html for more information about how to implement hooks.

Resolving patch:
diff --git a/PyInstaller/hooks/hook-webassets.py b/PyInstaller/hooks/hook-webassets.py
new file mode 100644
--- /dev/null
+++ b/PyInstaller/hooks/hook-webassets.py
@@ -0,0 +1,13 @@
+#-----------------------------------------------------------------------------
+# Copyright (c) 2005-2020, PyInstaller Development Team.
+#
+# Distributed under the terms of the GNU General Public License (version 2
+# or later) with exception for distributing the bootloader.
+#
+# The full license is in the file COPYING.txt, distributed with this software.
+#
+# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
+#-----------------------------------------------------------------------------
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = collect_data_files('webassets', include_py_files=True)


Test patch: