:github_url: https://github.com/kivymd/KivyMD/blob/master/kivymd/tools/packaging/pyinstaller/__init__.py

PyInstaller hooks
=================

.. py:module:: kivymd.tools.packaging.pyinstaller

.. autoapi-nested-parse::

   PyInstaller hooks
   =================

   Add ``hookspath=[kivymd.hooks_path]`` to your .spec file.

   Example of .spec file
   =====================

   .. code-block:: python

       # -*- mode: python ; coding: utf-8 -*-

       import sys
       import os

       from kivy_deps import sdl2, glew

       from kivymd import hooks_path as kivymd_hooks_path

       path = os.path.abspath(".")

       a = Analysis(
           ["main.py"],
           pathex=[path],
           hookspath=[kivymd_hooks_path],
           win_no_prefer_redirects=False,
           win_private_assemblies=False,
           cipher=None,
           noarchive=False,
       )
       pyz = PYZ(a.pure, a.zipped_data, cipher=None)

       exe = EXE(
           pyz,
           a.scripts,
           a.binaries,
           a.zipfiles,
           a.datas,
           *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
           debug=False,
           strip=False,
           upx=True,
           name="app_name",
           console=True,
       )


API - :mod:`kivymd.tools.packaging.pyinstaller`
-----------------------------------------------

.. py:data:: hooks_path

   Path to hook directory to use with PyInstaller.
   See :mod:`kivymd.tools.packaging.pyinstaller` for more information.


.. py:function:: get_hook_dirs()


.. py:function:: get_pyinstaller_tests()



Submodules
----------

.. toctree::
   :titlesonly:
   :maxdepth: 1

   kivymd.tools.packaging.pyinstaller.hook-kivymd </api/kivymd/tools/packaging/pyinstaller/hook-kivymd/index>
