Remove hardcoded libpython binaries and add debug step
All checks were successful
build / build-linux (push) Successful in 16s

This commit is contained in:
kdusek
2025-12-07 23:15:18 +01:00
parent 308ce7768e
commit 6a1fe63684
1807 changed files with 172293 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for BTrees: https://pypi.org/project/BTrees/4.5.1/
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('BTrees')

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# A fully customizable messagebox for customtkinter!
# (extension/add-on)
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("CTkMessagebox")

View File

@@ -0,0 +1,62 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for PyCryptodome library: https://pypi.python.org/pypi/pycryptodome
PyCryptodome is an almost drop-in replacement for the now unmaintained
PyCrypto library. The two are mutually exclusive as they live under
the same package ("Crypto").
PyCryptodome distributes dynamic libraries and builds them as if they were
Python C extensions (even though they are not extensions - as they can't be
imported by Python). It might sound a bit weird, but this decision is rooted
in PyPy and its partial and slow support for C extensions. However, this also
invalidates several of the existing methods used by PyInstaller to decide the
right files to pull in.
Even though this hook is meant to help with PyCryptodome only, it will be
triggered also when PyCrypto is installed, so it must be tested with both.
Tested with PyCryptodome 3.5.1, PyCrypto 2.6.1, Python 2.7 & 3.6, Fedora & Windows
"""
import os
import glob
from PyInstaller.compat import EXTENSION_SUFFIXES
from PyInstaller.utils.hooks import get_module_file_attribute
# Include the modules as binaries in a subfolder named like the package.
# Cryptodome's loader expects to find them inside the package directory for
# the main module. We cannot use hiddenimports because that would add the
# modules outside the package.
binaries = []
binary_module_names = [
'Crypto.Math', # First in the list
'Crypto.Cipher',
'Crypto.Util',
'Crypto.Hash',
'Crypto.Protocol',
'Crypto.PublicKey',
]
try:
for module_name in binary_module_names:
m_dir = os.path.dirname(get_module_file_attribute(module_name))
for ext in EXTENSION_SUFFIXES:
module_bin = glob.glob(os.path.join(m_dir, '_*%s' % ext))
for f in module_bin:
binaries.append((f, module_name.replace('.', os.sep)))
except ImportError:
# Do nothing for PyCrypto (Crypto.Math does not exist there)
pass

View File

@@ -0,0 +1,44 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for Cryptodome module: https://pypi.python.org/pypi/pycryptodomex
Tested with Cryptodomex 3.4.2, Python 2.7 & 3.5, Windows
"""
import os
import glob
from PyInstaller.compat import EXTENSION_SUFFIXES
from PyInstaller.utils.hooks import get_module_file_attribute
# Include the modules as binaries in a subfolder named like the package.
# Cryptodome's loader expects to find them inside the package directory for
# the main module. We cannot use hiddenimports because that would add the
# modules outside the package.
binaries = []
binary_module_names = [
'Cryptodome.Cipher',
'Cryptodome.Util',
'Cryptodome.Hash',
'Cryptodome.Protocol',
'Cryptodome.Math',
'Cryptodome.PublicKey',
]
for module_name in binary_module_names:
m_dir = os.path.dirname(get_module_file_attribute(module_name))
for ext in EXTENSION_SUFFIXES:
module_bin = glob.glob(os.path.join(m_dir, '_*%s' % ext))
for f in module_bin:
binaries.append((f, module_name.replace('.', '/')))

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for HtmlTestRunner: https://pypi.org/project/html-testRunner//1.2.1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('HtmlTestRunner')

View File

@@ -0,0 +1,42 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Tested with IPython 4.0.0.
from PyInstaller.compat import is_win, is_darwin
from PyInstaller.utils.hooks import collect_data_files
# Ignore 'matplotlib'. IPython contains support for matplotlib.
# Ignore GUI libraries. IPython supports integration with GUI frameworks.
# Assume that it will be imported by any other module when the user really
# uses it.
excludedimports = [
'gtk',
'matplotlib',
'PySide',
'PyQt4',
'PySide2',
'PyQt5',
'PySide6',
'PyQt6',
]
# IPython uses 'tkinter' for clipboard access on Linux/Unix. Exclude it on Windows and OS X.
if is_win or is_darwin:
excludedimports.append('tkinter')
datas = collect_data_files('IPython')
# IPython imports extensions by changing to the extensions directory and using
# importlib.import_module, so we need to copy over the extensions as if they
# were data files.
datas += collect_data_files('IPython.extensions', include_py_files=True)

View File

@@ -0,0 +1,65 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for PyOpenGL 3.x versions from 3.0.0b6 up. Previous versions have a
plugin system based on pkg_resources which is problematic to handle correctly
under pyinstaller; 2.x versions used to run fine without hooks, so this one
shouldn't hurt.
"""
from PyInstaller.compat import is_win, is_darwin
from PyInstaller.utils.hooks import collect_data_files, exec_statement
import os
import glob
def opengl_arrays_modules():
"""
Return list of array modules for OpenGL module.
e.g. 'OpenGL.arrays.vbo'
"""
statement = 'import OpenGL; print(OpenGL.__path__[0])'
opengl_mod_path = exec_statement(statement)
arrays_mod_path = os.path.join(opengl_mod_path, 'arrays')
files = glob.glob(arrays_mod_path + '/*.py')
modules = []
for f in files:
mod = os.path.splitext(os.path.basename(f))[0]
# Skip __init__ module.
if mod == '__init__':
continue
modules.append('OpenGL.arrays.' + mod)
return modules
# PlatformPlugin performs a conditional import based on os.name and
# sys.platform. PyInstaller misses this so let's add it ourselves...
if is_win:
hiddenimports = ['OpenGL.platform.win32']
elif is_darwin:
hiddenimports = ['OpenGL.platform.darwin']
# Use glx for other platforms (Linux, ...)
else:
hiddenimports = ['OpenGL.platform.glx']
# Arrays modules are needed too.
hiddenimports += opengl_arrays_modules()
# PyOpenGL 3.x uses ctypes to load DLL libraries. PyOpenGL windows installer
# adds necessary dll files to
# DLL_DIRECTORY = os.path.join( os.path.dirname( OpenGL.__file__ ), 'DLLS')
# PyInstaller is not able to find these dlls. Just include them all as data
# files.
if is_win:
datas = collect_data_files('OpenGL')

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
OpenGL_accelerate contais modules written in cython. This module
should speed up some functions from OpenGL module. The following
hiddenimports are not resolved by PyInstaller because OpenGL_accelerate
is compiled to native Python modules.
"""
hiddenimports = [
'OpenGL_accelerate.wrapper',
'OpenGL_accelerate.formathandler',
]

View File

@@ -0,0 +1,14 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("PyTaskbar")

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('Xlib')

View File

@@ -0,0 +1,13 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
hiddenimports = ['uuid']

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for _mysql, required if higher-level pure python module is not imported
"""
hiddenimports = ['_mysql_exceptions']

View File

@@ -0,0 +1,18 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
accessible_output2: http://hg.q-continuum.net/accessible_output2
"""
from PyInstaller.utils.hooks import collect_dynamic_libs
binaries = collect_dynamic_libs('accessible_output2')

View File

@@ -0,0 +1,23 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies
# adb.exe is not automatically collected by collect_dynamic_libs()
datas = collect_data_files("adbutils", subdir="binaries", includes=["adb*"])
# adbutils v2.2.2 replaced `pkg_resources` with `importlib.resources`, and now uses the following code to determine the
# path to the `adbutils.binaries` sub-package directory:
# https://github.com/openatx/adbutils/blob/2.2.2/adbutils/_utils.py#L78-L87
# As `adbutils.binaries` is not directly imported anywhere, we need a hidden import.
if is_module_satisfies('adbutils >= 2.2.2'):
hiddenimports = ['adbutils.binaries']

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for http://pypi.python.org/pypi/adios/
"""
hiddenimports = ['adios._hl.selections']

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for afmformats: https://pypi.python.org/pypi/afmformats
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('afmformats')

View File

@@ -0,0 +1,14 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("aliyunsdkcore")

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("altair")

View File

@@ -0,0 +1,26 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for Python bindings for Amazon's Product Advertising API.
https://bitbucket.org/basti/python-amazon-product-api
"""
hiddenimports = ['amazonproduct.processors.__init__',
'amazonproduct.processors._lxml',
'amazonproduct.processors.objectify',
'amazonproduct.processors.elementtree',
'amazonproduct.processors.etree',
'amazonproduct.processors.minidom',
'amazonproduct.contrib.__init__',
'amazonproduct.contrib.cart',
'amazonproduct.contrib.caching',
'amazonproduct.contrib.retry']

View File

@@ -0,0 +1,19 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
AnyIO contains a number of back-ends as dynamically imported modules.
This hook was tested against AnyIO v1.4.0.
"""
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('anyio._backends')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("apkutils")

View File

@@ -0,0 +1,21 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Import hook for appdirs.
On Windows, appdirs tries 2 different methods to get well-known directories
from the system: First with win32com, then with ctypes. Excluding win32com here
avoids including all the win32com related DLLs in programs that don't include
them otherwise.
"""
excludedimports = ['win32com']

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for appy.pod: https://pypi.python.org/pypi/appy/0.9.1
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('appy.pod', True)

View File

@@ -0,0 +1,27 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
APScheduler uses entry points to dynamically load executors, job
stores and triggers.
This hook was tested against APScheduler 3.6.3.
"""
from PyInstaller.utils.hooks import (collect_submodules, copy_metadata,
is_module_satisfies)
if is_module_satisfies("apscheduler < 4"):
if is_module_satisfies("pyinstaller >= 4.4"):
datas = copy_metadata('APScheduler', recursive=True)
else:
datas = copy_metadata('APScheduler')
hiddenimports = collect_submodules('apscheduler')

View File

@@ -0,0 +1,13 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
hiddenimports = ["_cffi_backend"]

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('astor')

View File

@@ -0,0 +1,48 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# ***************************************************
# hook-astriod.py - PyInstaller hook file for astriod
# ***************************************************
# The astriod package, in __pkginfo__.py, is version 1.1.1. Looking at its
# source:
#
# From __init__.py, starting at line 111::
#
# BRAIN_MODULES_DIR = join(dirname(__file__), 'brain')
# if BRAIN_MODULES_DIR not in sys.path:
# # add it to the end of the list so user path take precedence
# sys.path.append(BRAIN_MODULES_DIR)
# # load modules in this directory
# for module in listdir(BRAIN_MODULES_DIR):
# if module.endswith('.py'):
# __import__(module[:-3])
#
# So, we need all the Python source in the ``brain/`` subdirectory,
# since this is run-time discovered and loaded. Therefore, these
# files are all data files.
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, \
is_module_or_submodule
# Note that brain/ isn't a module (it lacks an __init__.py, so it can't be
# referred to as astroid.brain; instead, locate it as package astriod,
# subdirectory brain/.
datas = collect_data_files('astroid', True, 'brain')
# Update: in astroid v 1.4.1, the brain/ module import parts of astroid. Since
# everything in brain/ is dynamically imported, these are hidden imports. For
# simplicity, include everything in astroid. Exclude all the test/ subpackage
# contents and the test_util module.
hiddenimports = ['six'] + collect_submodules('astroid',
lambda name: (not is_module_or_submodule(name, 'astroid.tests')) and
(not name == 'test_util'))

View File

@@ -0,0 +1,42 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, \
copy_metadata, is_module_satisfies
# Astropy includes a number of non-Python files that need to be present
# at runtime, so we include these explicitly here.
datas = collect_data_files('astropy')
# In a number of places, astropy imports other sub-modules in a way that is not
# always auto-discovered by pyinstaller, so we always include all submodules.
hiddenimports = collect_submodules('astropy')
# We now need to include the *_parsetab.py and *_lextab.py files for unit and
# coordinate parsing, since these are loaded as files rather than imported as
# sub-modules. We leverage collect_data_files to get all files in astropy then
# filter these.
ply_files = []
for path, target in collect_data_files('astropy', include_py_files=True):
if path.endswith(('_parsetab.py', '_lextab.py')):
ply_files.append((path, target))
datas += ply_files
# Astropy version >= 5.0 queries metadata to get version information.
if is_module_satisfies('astropy >= 5.0'):
datas += copy_metadata('astropy')
datas += copy_metadata('numpy')
# In the Cython code, Astropy imports numpy.lib.recfunctions which isn't
# automatically discovered by pyinstaller, so we add this as a hidden import.
hiddenimports += ['numpy.lib.recfunctions']

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for https://github.com/astropy/astropy-iers-data
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("astropy_iers_data")

View File

@@ -0,0 +1,44 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import os
from PyInstaller.compat import is_win
from PyInstaller.utils.hooks import collect_submodules, is_module_satisfies, get_package_paths
hiddenimports = ['fractions'] + collect_submodules("av")
# Starting with av 9.1.1, the DLLs shipped with Windows PyPI wheels are stored
# in site-packages/av.libs instead of directly in the site-packages/av.
if is_module_satisfies("av >= 9.1.1") and is_win:
pkg_base, pkg_dir = get_package_paths("av")
lib_dir = os.path.join(pkg_base, "av.libs")
if os.path.isdir(lib_dir):
# We collect DLLs as data files instead of binaries to suppress binary
# analysis, which would result in duplicates (because it collects a copy
# into the top-level directory instead of preserving the original layout).
# In addition to DLls, this also collects .load-order* file (required on
# python < 3.8), and ensures that Shapely.libs directory exists (required
# on python >= 3.8 due to os.add_dll_directory call).
datas = [
(os.path.join(lib_dir, lib_file), 'av.libs')
for lib_file in os.listdir(lib_dir)
]
# With av 13.0.0, one of the cythonized modules (`av.audio.layout`) started using `dataclasses`. Add it to hidden
# imports to ensure it is collected in cases when it is not referenced from anywhere else.
if is_module_satisfies("av >= 13.0.0"):
hiddenimports += ['dataclasses']
# av 13.1.0 added a cythonized `av.opaque` module that uses `uuid`; add it to hidden imports to ensure it is collected
# in cases when it is not referenced from anywhere else.
if is_module_satisfies("av >= 13.1.0"):
hiddenimports += ['uuid']

View File

@@ -0,0 +1,27 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Avro is a serialization and RPC framework.
"""
import os
from PyInstaller.utils.hooks import get_module_file_attribute
res_loc = os.path.dirname(get_module_file_attribute("avro"))
# see https://github.com/apache/avro/blob/master/lang/py3/setup.py
datas = [
# Include the version.txt file, used to set __version__
(os.path.join(res_loc, "VERSION.txt"), "avro"),
# The handshake schema is needed for IPC communication
(os.path.join(res_loc, "HandshakeRequest.avsc"), "avro"),
(os.path.join(res_loc, "HandshakeResponse.avsc"), "avro"),
]

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Azurerm is a lite api to microsoft azure.
# Azurerm is using pkg_resources internally which is not supported by py-installer.
# This hook will collect the module metadata.
# Tested with Azurerm 0.10.0
from PyInstaller.utils.hooks import copy_metadata, is_module_satisfies
if is_module_satisfies("pyinstaller >= 4.4"):
datas = copy_metadata("azurerm", recursive=True)
else:
datas = copy_metadata("azurerm")

View File

@@ -0,0 +1,20 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Some of jaraco's backports packages (backports.functools-lru-cache, backports.tarfile) use pkgutil-style `backports`
# namespace package, with `__init__.py` file that contains:
#
# __path__ = __import__('pkgutil').extend_path(__path__, __name__)
#
# This import via `__import__` function slips past PyInstaller's modulegraph analysis; so add a hidden import, in case
# the user's program (and its dependencies) have no other direct imports of `pkgutil`.
hiddenimports = ['pkgutil']

View File

@@ -0,0 +1,18 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.compat import is_win
# On Windows, timezone data is provided by the tzdata package that is
# not directly loaded.
if is_win:
hiddenimports = ['tzdata']

View File

@@ -0,0 +1,50 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for Bacon (https://github.com/aholkner/bacon)
# Bacon requires its native DLLs to be copied alongside frozen executable.
import os
import ctypes
from PyInstaller.compat import is_win, is_darwin
from PyInstaller.utils.hooks import get_package_paths
def collect_native_files(package, files):
pkg_base, pkg_dir = get_package_paths(package)
return [(os.path.join(pkg_dir, file), '.') for file in files]
if is_win:
files = ['Bacon.dll',
'd3dcompiler_46.dll',
'libEGL.dll',
'libGLESv2.dll',
'msvcp110.dll',
'msvcr110.dll',
'vccorllib110.dll']
if ctypes.sizeof(ctypes.c_void_p) == 4:
hiddenimports = ["bacon.windows32"]
datas = collect_native_files('bacon.windows32', files)
else:
hiddenimports = ["bacon.windows64"]
datas = collect_native_files('bacon.windows64', files)
elif is_darwin:
if ctypes.sizeof(ctypes.c_void_p) == 4:
hiddenimports = ["bacon.darwin32"]
files = ['Bacon.dylib']
datas = collect_native_files('bacon.darwin32', files)
else:
hiddenimports = ["bacon.darwin64"]
files = ['Bacon64.dylib']
datas = collect_native_files('bacon.darwin64', files)

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for https://pypi.org/project/bcrypt/
"""
hiddenimports = ['_cffi_backend']

View File

@@ -0,0 +1,23 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ---------------------------------------------------
from PyInstaller.utils.hooks import collect_dynamic_libs
# bitsandbytes contains several extensions for CPU and different CUDA versions: libbitsandbytes_cpu.so,
# libbitsandbytes_cuda110_nocublaslt.so, libbitsandbytes_cuda110.so, etc. At build-time, we could query the
# `bitsandbytes.cextension.setup` and its `binary_name` attribute for the extension that is in use. However, if the
# build system does not have CUDA available, this would automatically mean that we will not collect any of the CUDA
# libs. So for now, we collect them all.
binaries = collect_dynamic_libs("bitsandbytes")
# bitsandbytes uses triton's JIT module, which requires access to source .py files.
module_collection_mode = 'pyz+py'

View File

@@ -0,0 +1,29 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
# These are all imported from cythonized extensions.
hiddenimports = [
'json',
'platform',
'click',
'mypy_extensions',
'pathspec',
'_black_version',
'platformdirs',
*collect_submodules('black'),
# blib2to3.pytree, blib2to3.pygen, various submodules from blib2to3.pgen2; best to just collect all submodules.
*collect_submodules('blib2to3'),
]
# Ensure that `black/resources/black.schema.json` is collected, in case someone tries to call `black.schema.get_schema`.
datas = collect_data_files('black')

View File

@@ -0,0 +1,19 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# hook for https://github.com/hbldh/bleak
from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
from PyInstaller.compat import is_win
if is_win:
datas = collect_data_files('bleak', subdir=r'backends\dotnet')
binaries = collect_dynamic_libs('bleak')

View File

@@ -0,0 +1,35 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from _pyinstaller_hooks_contrib.compat import importlib_metadata
# Find the mypyc extension module for `black`, which is called something like `30fcd23745efe32ce681__mypyc`. The prefix
# changes with each `black` version, so we need to obtain the name by looking at distribution's list of files.
def _find_mypyc_module():
try:
dist = importlib_metadata.distribution("black")
except importlib_metadata.PackageNotFoundError:
return []
return [entry.name.split('.')[0] for entry in (dist.files or []) if '__mypyc' in entry.name]
hiddenimports = [
*_find_mypyc_module(),
'dataclasses',
'pkgutil',
'tempfile',
*collect_submodules('blib2to3')
]
# Ensure that data files, such as `PatternGrammar.txt` and `Grammar.txt`, are collected.
datas = collect_data_files('blib2to3')

View File

@@ -0,0 +1,35 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import os
import glob
from PyInstaller.utils.hooks import get_module_file_attribute
from PyInstaller.compat import is_win
# blspy comes as a stand-alone extension module that's placed directly
# in site-packages.
#
# On macOS and Linux, it is linked against the GMP library, whose shared
# library is stored in blspy.libs and .dylibsblspy, respectively. As this
# is a linked dependency, it is collected properly by PyInstaller and
# no further work is needed.
#
# On Windows, however, the blspy extension is linked against MPIR library,
# whose DLLs are placed directly into site-packages. The mpir.dll is
# linked dependency and is picked up automatically, but it in turn
# dynamically loads CPU-specific backends that are named mpir_*.dll.
# We need to colllect these manually.
if is_win:
blspy_dir = os.path.dirname(get_module_file_attribute('blspy'))
mpir_dlls = glob.glob(os.path.join(blspy_dir, 'mpir_*.dll'))
binaries = [(mpir_dll, '.') for mpir_dll in mpir_dlls]

View File

@@ -0,0 +1,27 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files, copy_metadata, is_module_satisfies
# core/_templates/*
# server/static/**/*
# subcommands/*.py
# bokeh/_sri.json
datas = collect_data_files('bokeh.core') + \
collect_data_files('bokeh.server') + \
collect_data_files('bokeh.command.subcommands', include_py_files=True) + \
collect_data_files('bokeh')
# bokeh >= 3.0.0 sets its __version__ from metadata
if is_module_satisfies('bokeh >= 3.0.0'):
datas += copy_metadata('bokeh')

View File

@@ -0,0 +1,25 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# Boto3, the next version of Boto, is now stable and recommended for general
# use.
#
# Boto is an integrated interface to current and future infrastructural
# services offered by Amazon Web Services.
#
# http://boto.readthedocs.org/en/latest/
#
# Tested with boto 2.38.0
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('boto')

View File

@@ -0,0 +1,29 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# Boto is the Amazon Web Services (AWS) SDK for Python, which allows Python
# developers to write software that makes use of Amazon services like S3 and
# EC2. Boto provides an easy to use, object-oriented API as well as low-level
# direct service access.
#
# http://boto3.readthedocs.org/en/latest/
#
# Tested with boto3 1.2.1
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
hiddenimports = (
collect_submodules('boto3.dynamodb') +
collect_submodules('boto3.ec2') +
collect_submodules('boto3.s3')
)
datas = collect_data_files('boto3')

View File

@@ -0,0 +1,30 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# Botocore is a low-level interface to a growing number of Amazon Web Services.
# Botocore serves as the foundation for the AWS-CLI command line utilities. It
# will also play an important role in the boto3.x project.
#
# The botocore package is compatible with Python versions 2.6.5, Python 2.7.x,
# and Python 3.3.x and higher.
#
# https://botocore.readthedocs.org/en/latest/
#
# Tested with botocore 1.4.36
from PyInstaller.utils.hooks import collect_data_files
from PyInstaller.utils.hooks import is_module_satisfies
if is_module_satisfies('botocore >= 1.4.36'):
hiddenimports = ['html.parser']
datas = collect_data_files('botocore')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("branca")

View File

@@ -0,0 +1,45 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import ctypes.util
import os
from PyInstaller.depend.utils import _resolveCtypesImports
from PyInstaller.utils.hooks import collect_data_files, is_module_satisfies, logger
datas = collect_data_files("cairocffi")
binaries = []
# NOTE: Update this if cairocffi requires more libraries
libs = ["cairo-2", "cairo", "libcairo-2"]
try:
lib_basenames = []
for lib in libs:
libname = ctypes.util.find_library(lib)
if libname is not None:
lib_basenames += [os.path.basename(libname)]
if lib_basenames:
resolved_libs = _resolveCtypesImports(lib_basenames)
for resolved_lib in resolved_libs:
binaries.append((resolved_lib[1], '.'))
except Exception as e:
logger.warning("Error while trying to find system-installed Cairo library: %s", e)
if not binaries:
logger.warning("Cairo library not found - cairocffi will likely fail to work!")
# cairocffi 1.6.0 requires cairocffi/constants.py source file, so make sure it is collected.
# The module collection mode setting requires PyInstaller >= 5.3.
if is_module_satisfies('cairocffi >= 1.6.0'):
module_collection_mode = {'cairocffi.constants': 'pyz+py'}

View File

@@ -0,0 +1,40 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import ctypes.util
import os
from PyInstaller.depend.utils import _resolveCtypesImports
from PyInstaller.utils.hooks import collect_data_files, logger
datas = collect_data_files("cairosvg")
binaries = []
# NOTE: Update this if cairosvg requires more libraries
libs = ["cairo-2", "cairo", "libcairo-2"]
try:
lib_basenames = []
for lib in libs:
libname = ctypes.util.find_library(lib)
if libname is not None:
lib_basenames += [os.path.basename(libname)]
if lib_basenames:
resolved_libs = _resolveCtypesImports(lib_basenames)
for resolved_lib in resolved_libs:
binaries.append((resolved_lib[1], '.'))
except Exception as e:
logger.warning("Error while trying to find system-installed Cairo library: %s", e)
if not binaries:
logger.warning("Cairo library not found - cairosvg will likely fail to work!")

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_dynamic_libs
# Collect needed libraries for capstone
binaries = collect_dynamic_libs('capstone')

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# A modern, feature-rich and highly-tunable Python client library for Apache Cassandra (2.1+) and
# DataStax Enterprise (4.7+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3.
#
# http://datastax.github.io/python-driver/api/index.html
#
# Tested with cassandra-driver 3.25.0
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('cassandra')

View File

@@ -0,0 +1,24 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# cel-python is Pure Python implementation of Google Common Expression Language,
# https://opensource.google/projects/cel
# This implementation has minimal dependencies, runs quickly, and can be embedded into Python-based applications.
# Specifically, the intent is to be part of Cloud Custodian, C7N, as part of the security policy filter.
# https://github.com/cloud-custodian/cel-python
#
# Tested with cel-python 0.1.5
from PyInstaller.utils.hooks import collect_data_files
# Collect *.lark file(s) from the package
datas = collect_data_files('celpy')

View File

@@ -0,0 +1,21 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Certifi is a carefully curated collection of Root Certificates for
# validating the trustworthiness of SSL certificates while verifying
# the identity of TLS hosts.
# It has been extracted from the Requests project.
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('certifi')

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
# Include data files from cf_units/etc sub-directory.
datas = collect_data_files('cf_units', includes=['etc/**'])

View File

@@ -0,0 +1,21 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# The cftime._cftime is a cython exension with following hidden imports:
hiddenimports = [
're',
'time',
'datetime',
'warnings',
'numpy',
'cftime._strptime',
]

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import is_module_satisfies
if is_module_satisfies("charset_normalizer >= 3.0.1"):
hiddenimports = ["charset_normalizer.md__mypyc"]

View File

@@ -0,0 +1,18 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import is_module_satisfies
# cloudpickle to 3.0.0 keeps `cloudpickle_fast` module around for backward compatibility with existing pickled data,
# but does not import it directly anymore. Ensure it is collected nevertheless.
if is_module_satisfies("cloudpickle >= 3.0.0"):
hiddenimports = ["cloudpickle.cloudpickle_fast"]

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('cloudscraper')

View File

@@ -0,0 +1,55 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# There is a name clash between pythonnet's clr module/extension (which this hooks is for) and clr package that provides
# the terminal styling library (https://pypi.org/project/clr/). Therefore, we must first check if pythonnet is actually
# available...
from PyInstaller.utils.hooks import is_module_satisfies
from PyInstaller.compat import is_win
if is_module_satisfies("pythonnet"):
# pythonnet requires both clr.pyd and Python.Runtime.dll, but the latter isn't found by PyInstaller.
import ctypes.util
from PyInstaller.log import logger
from _pyinstaller_hooks_contrib.compat import importlib_metadata
collected_runtime_files = []
# Try finding Python.Runtime.dll via distribution's file list
dist_files = importlib_metadata.files('pythonnet') or []
runtime_dll_files = [f for f in dist_files if f.match('Python.Runtime.dll')]
if len(runtime_dll_files) == 1:
runtime_dll_file = runtime_dll_files[0]
collected_runtime_files = [(runtime_dll_file.locate(), runtime_dll_file.parent.as_posix())]
logger.debug("hook-clr: Python.Runtime.dll discovered via metadata.")
elif len(runtime_dll_files) > 1:
logger.warning("hook-clr: multiple instances of Python.Runtime.dll listed in metadata - cannot resolve.")
# Fall back to the legacy way
if not collected_runtime_files:
runtime_dll_file = ctypes.util.find_library('Python.Runtime')
if runtime_dll_file:
collected_runtime_files = [(runtime_dll_file, '.')]
logger.debug('hook-clr: Python.Runtime.dll discovered via legacy method.')
if not collected_runtime_files:
raise Exception('Python.Runtime.dll not found')
# On Windows, collect runtime DLL file(s) as binaries; on other OSes, collect them as data files, to prevent fatal
# errors in binary dependency analysis.
if is_win:
binaries = collected_runtime_files
else:
datas = collected_runtime_files
# These modules are imported inside Python.Runtime.dll
hiddenimports = ["platform", "warnings"]

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.compat import is_win, is_cygwin
from PyInstaller.utils.hooks import collect_dynamic_libs
# The clr-loader is used by pythonnet 3.x to load CLR (.NET) runtime.
# On Windows, the default runtime is the .NET Framework, and its corresponding
# loader requires DLLs from clr_loader\ffi\dlls to be collected. This runtime
# is supported only on Windows, so we do not have to worry about it on other
# OSes (where Mono or .NET Core are supported).
if is_win or is_cygwin:
binaries = collect_dynamic_libs("clr_loader")

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("cmocean", subdir="rgb")

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules, copy_metadata, collect_data_files
# Collect submodules to ensure that checker plugins are collected. but avoid collecting tests sub-package.
hiddenimports = collect_submodules('compliance_checker', filter=lambda name: name != 'compliance_checker.tests')
# Copy metadata, because checker plugins are discovered via entry-points
datas = copy_metadata('compliance_checker')
# Include data files from compliance_checker/data sub-directory.
datas += collect_data_files('compliance_checker', includes=['data/**'])

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# https://github.com/enthought/comtypes/blob/1.4.5/comtypes/client/_generate.py#L271-L280
hiddenimports = [
"comtypes.persist",
"comtypes.typeinfo",
"comtypes.automation",
"comtypes.stream",
"comtypes",
"ctypes.wintypes",
"ctypes",
]

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('countrycode')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata("countryinfo") + collect_data_files("countryinfo")

View File

@@ -0,0 +1,132 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for cryptography module from the Python Cryptography Authority.
"""
import os
import glob
import pathlib
from PyInstaller import compat
from PyInstaller import isolated
from PyInstaller.utils.hooks import (
collect_submodules,
copy_metadata,
get_module_file_attribute,
is_module_satisfies,
logger,
)
# get the package data so we can load the backends
datas = copy_metadata('cryptography')
# Add the backends as hidden imports
hiddenimports = collect_submodules('cryptography.hazmat.backends')
# Add the OpenSSL FFI binding modules as hidden imports
hiddenimports += collect_submodules('cryptography.hazmat.bindings.openssl') + ['_cffi_backend']
# Include the cffi extensions as binaries in a subfolder named like the package.
# The cffi verifier expects to find them inside the package directory for
# the main module. We cannot use hiddenimports because that would add the modules
# outside the package.
# NOTE: this is not true anymore with PyInstaller >= 6.0, but we keep it like this for compatibility with 5.x series.
binaries = []
cryptography_dir = os.path.dirname(get_module_file_attribute('cryptography'))
for ext in compat.EXTENSION_SUFFIXES:
ffimods = glob.glob(os.path.join(cryptography_dir, '*_cffi_*%s*' % ext))
for f in ffimods:
binaries.append((f, 'cryptography'))
# Check if `cryptography` is dynamically linked against OpenSSL >= 3.0.0. In that case, we might need to collect
# external OpenSSL modules, if OpenSSL was built with modules support. It seems the best indication of this is the
# presence of `ossl-modules` directory next to the OpenSSL shared library.
#
# NOTE: PyPI wheels ship with extensions statically linked against OpenSSL, so this is mostly catering alternative
# installation methods (Anaconda on all OSes, Homebrew on macOS, various linux distributions).
try:
@isolated.decorate
def _check_cryptography_openssl3():
# Check if OpenSSL 3 is used.
from cryptography.hazmat.backends.openssl.backend import backend
openssl_version = backend.openssl_version_number()
if openssl_version < 0x30000000:
return False, None
# Obtain path to the bindings module for binary dependency analysis. Under older versions of cryptography,
# this was a separate `_openssl` module; in contemporary versions, it is `_rust` module.
try:
import cryptography.hazmat.bindings._openssl as bindings_module
except ImportError:
import cryptography.hazmat.bindings._rust as bindings_module
return True, str(bindings_module.__file__)
uses_openssl3, bindings_module = _check_cryptography_openssl3()
except Exception:
logger.warning(
"hook-cryptography: failed to determine whether cryptography is using OpenSSL >= 3.0.0", exc_info=True
)
uses_openssl3, bindings_module = False, None
if uses_openssl3:
# Determine location of OpenSSL shared library, provided that extension module is dynamically linked against it.
# This requires the new PyInstaller.bindepend API from PyInstaller >= 6.0.
openssl_lib = None
if is_module_satisfies("PyInstaller >= 6.0"):
from PyInstaller.depend import bindepend
if compat.is_win:
SSL_LIB_NAME = 'libssl-3-x64.dll' if compat.is_64bits else 'libssl-3.dll'
elif compat.is_darwin:
SSL_LIB_NAME = 'libssl.3.dylib'
else:
SSL_LIB_NAME = 'libssl.so.3'
linked_libs = bindepend.get_imports(bindings_module)
openssl_lib = [
# Compare the basename of lib_name, because lib_fullpath is None if we fail to resolve the library.
lib_fullpath for lib_name, lib_fullpath in linked_libs if os.path.basename(lib_name) == SSL_LIB_NAME
]
openssl_lib = openssl_lib[0] if openssl_lib else None
else:
logger.warning(
"hook-cryptography: full support for cryptography + OpenSSL >= 3.0.0 requires PyInstaller >= 6.0"
)
# Check for presence of ossl-modules directory next to the OpenSSL shared library.
if openssl_lib:
logger.info("hook-cryptography: cryptography uses dynamically-linked OpenSSL: %r", openssl_lib)
openssl_lib_dir = pathlib.Path(openssl_lib).parent
# Collect whole ossl-modules directory, if it exists.
ossl_modules_dir = openssl_lib_dir / 'ossl-modules'
# Msys2/MinGW installations on Windows put the shared library into `bin` directory, but the modules are
# located in `lib` directory. Account for that possibility.
if not ossl_modules_dir.is_dir() and openssl_lib_dir.name == 'bin':
ossl_modules_dir = openssl_lib_dir.parent / 'lib' / 'ossl-modules'
# On Alpine linux, the true location of shared library is /lib directory, but the modules' directory is located
# in /usr/lib instead. Account for that possibility.
if not ossl_modules_dir.is_dir() and openssl_lib_dir == pathlib.Path('/lib'):
ossl_modules_dir = pathlib.Path('/usr/lib/ossl-modules')
if ossl_modules_dir.is_dir():
logger.debug("hook-cryptography: collecting OpenSSL modules directory: %r", str(ossl_modules_dir))
binaries.append((str(ossl_modules_dir), 'ossl-modules'))
else:
logger.info("hook-cryptography: cryptography does not seem to be using dynamically linked OpenSSL.")

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
from PyInstaller.utils.hooks import collect_data_files
# Collect files from cumm/include directory - at import, the package asserts the existence of this directory.
datas = collect_data_files('cumm')

View File

@@ -0,0 +1,14 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("customtkinter")

View File

@@ -0,0 +1,168 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import sys
import os
import glob
import pathlib
import PyInstaller.utils.hooks as hookutils
from PyInstaller import compat
hiddenimports = ['numpy']
# On Windows, make sure that opencv_videoio_ffmpeg*.dll is bundled
binaries = []
if compat.is_win:
# If conda is active, look for the DLL in its library path
if compat.is_conda:
libdir = os.path.join(compat.base_prefix, 'Library', 'bin')
pattern = os.path.join(libdir, 'opencv_videoio_ffmpeg*.dll')
for f in glob.glob(pattern):
binaries.append((f, '.'))
# Include any DLLs from site-packages/cv2 (opencv_videoio_ffmpeg*.dll
# can be found there in the PyPI version)
binaries += hookutils.collect_dynamic_libs('cv2')
# Collect auxiliary sub-packages, such as `cv2.gapi`, `cv2.mat_wrapper`, `cv2.misc`, and `cv2.utils`. This also
# picks up submodules with valid module names, such as `cv2.config`, `cv2.load_config_py2`, and `cv2.load_config_py3`.
# Therefore, filter out `cv2.load_config_py2`.
hiddenimports += hookutils.collect_submodules('cv2', filter=lambda name: name != 'cv2.load_config_py2')
# We also need to explicitly exclude `cv2.load_config_py2` due to it being imported in `cv2.__init__`.
excludedimports = ['cv2.load_config_py2']
# OpenCV loader from 4.5.4.60 requires extra config files and modules.
# We need to collect `config.py` and `load_config_py3`; to improve compatibility with PyInstaller < 5.2, where
# `module_collection_mode` (see below) is not implemented.
# We also need to collect `config-3.py` or `config-3.X.py`, whichever is available (the former is usually
# provided by PyPI wheels, while the latter seems to be used when user builds OpenCV from source).
datas = hookutils.collect_data_files(
'cv2',
include_py_files=True,
includes=[
'config.py',
f'config-{sys.version_info[0]}.{sys.version_info[1]}.py',
'config-3.py',
'load_config_py3.py',
],
)
# The OpenCV versions that attempt to perform module substitution via sys.path manipulation (== 4.5.4.58, >= 4.6.0.66)
# do not directly import the cv2.cv2 extension anymore, so in order to ensure it is collected, we would need to add it
# to hidden imports. However, when OpenCV is built by user from source, the extension is not located in the package's
# root directory, but in python-3.X sub-directory, which precludes referencing via module name due to sub-directory
# not being a valid subpackage name. Hence, emulate the OpenCV's loader and execute `config-3.py` or `config-3.X.py`
# to obtain the search path.
def find_cv2_extension(config_file):
# Prepare environment
PYTHON_EXTENSIONS_PATHS = []
LOADER_DIR = os.path.dirname(os.path.abspath(os.path.realpath(config_file)))
global_vars = globals().copy()
local_vars = locals().copy()
# Exec the config file
with open(config_file) as fp:
code = compile(fp.read(), os.path.basename(config_file), 'exec')
exec(code, global_vars, local_vars)
# Read the modified PYTHON_EXTENSIONS_PATHS
PYTHON_EXTENSIONS_PATHS = local_vars['PYTHON_EXTENSIONS_PATHS']
if not PYTHON_EXTENSIONS_PATHS:
return None
# Search for extension file
for extension_path in PYTHON_EXTENSIONS_PATHS:
extension_path = pathlib.Path(extension_path)
if compat.is_win:
extension_files = list(extension_path.glob('cv2*.pyd'))
else:
extension_files = list(extension_path.glob('cv2*.so'))
if extension_files:
if len(extension_files) > 1:
hookutils.logger.warning("Found multiple cv2 extension candidates: %s", extension_files)
extension_file = extension_files[0] # Take first (or hopefully the only one)
hookutils.logger.debug("Found cv2 extension module: %s", extension_file)
# Compute path relative to parent of config file (which should be the package's root)
dest_dir = pathlib.Path("cv2") / extension_file.parent.relative_to(LOADER_DIR)
return str(extension_file), str(dest_dir)
hookutils.logger.warning(
"Could not find cv2 extension module! Config file: %s, search paths: %s",
config_file, PYTHON_EXTENSIONS_PATHS)
return None
config_file = [
src_path for src_path, _ in datas
if os.path.basename(src_path) in (f'config-{sys.version_info[0]}.{sys.version_info[1]}.py', 'config-3.py')
]
if config_file:
try:
extension_info = find_cv2_extension(config_file[0])
if extension_info:
ext_src, ext_dst = extension_info
# Due to bug in PyInstaller's TOC structure implementation (affecting PyInstaller up to latest version at
# the time of writing, 5.9), we fail to properly resolve `cv2.cv2` EXTENSION entry's destination name if
# we already have a BINARY entry with the same destination name. This results in verbatim `cv2.cv2` file
# created in application directory in addition to the proper copy in the `cv2` sub-directoy.
# Therefoe, if destination directory of the cv2 extension module is the top-level package directory, fall
# back to using hiddenimports instead.
if ext_dst == 'cv2':
# Extension found in top-level package directory; likely a PyPI wheel.
hiddenimports += ['cv2.cv2']
else:
# Extension found in sub-directory; use BINARY entry
binaries += [extension_info]
except Exception:
hookutils.logger.warning("Failed to determine location of cv2 extension module!", exc_info=True)
# Mark the cv2 package to be collected in source form, bypassing PyInstaller's PYZ archive and FrozenImporter. This is
# necessary because recent versions of cv2 package attempt to perform module substritution via sys.path manipulation,
# which is incompatible with the way that FrozenImporter works. This requires pyinstaller/pyinstaller#6945, i.e.,
# PyInstaller >= 5.3. On earlier versions, the following statement does nothing, and problematic cv2 versions
# (== 4.5.4.58, >= 4.6.0.66) will not work.
#
# Note that the collect_data_files() above is still necessary, because some of the cv2 loader's config scripts are not
# valid module names (e.g., config-3.py). So the two collection approaches are complementary, and any overlap in files
# (e.g., __init__.py) is handled gracefully due to PyInstaller's uniqueness constraints on collected files.
module_collection_mode = 'py'
# In linux PyPI opencv-python wheels, the cv2 extension is linked against Qt, and the wheel bundles a basic subset of Qt
# shared libraries, plugins, and font files. This is not the case on other OSes (presumably native UI APIs are used by
# OpenCV HighGUI module), nor in the headless PyPI wheels (opencv-python-headless).
# The bundled Qt shared libraries should be picked up automatically due to binary dependency analysis, but we need to
# collect plugins and font files from the `qt` subdirectory.
if compat.is_linux:
pkg_path = pathlib.Path(hookutils.get_module_file_attribute('cv2')).parent
# Collect .ttf files fron fonts directory.
# NOTE: since we are using glob, we can skip checks for (sub)directories' existence.
qt_fonts_dir = pkg_path / 'qt' / 'fonts'
datas += [
(str(font_file), str(font_file.parent.relative_to(pkg_path.parent)))
for font_file in qt_fonts_dir.rglob('*.ttf')
]
# Collect .so files from plugins directory.
qt_plugins_dir = pkg_path / 'qt' / 'plugins'
binaries += [
(str(plugin_file), str(plugin_file.parent.relative_to(pkg_path.parent)))
for plugin_file in qt_plugins_dir.rglob('*.so')
]

View File

@@ -0,0 +1,13 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
hiddenimports = ['decimal']

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for the cytoolz package: https://pypi.python.org/pypi/cytoolz
# Tested with cytoolz 0.9.0 and Python 3.5.2, on Ubuntu Linux x64
hiddenimports = ['cytoolz.utils', 'cytoolz._signatures']

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_bootstrap_components')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_core_components')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_html_components')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_renderer')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_table')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dash_uploader')

View File

@@ -0,0 +1,19 @@
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
#-----------------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
# Collect data files:
# - dask.yaml
# - dask-schema.yaml
# - widgets/templates/*.html.j2 (but avoid collecting files from `widgets/tests/templates`!)
datas = collect_data_files('dask', includes=['*.yml', '*.yaml', 'widgets/templates/*.html.j2'])

View File

@@ -0,0 +1,14 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Collect source .py files for JIT/torchscript. Requires PyInstaller >= 5.3, no-op in older versions.
module_collection_mode = 'pyz+py'

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
# Ensure that `dateparser/data/dateparser_tz_cache.pkl` data file is collected. Applicable to dateparser >= v1.2.2;
# earlier releases have no data files, so this call returns empty list.
datas = collect_data_files('dateparser')

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for dateparser: https://pypi.org/project/dateparser/
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = ["_strptime"] + collect_submodules('dateparser.data')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("dateutil")

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules
# Collect all submodules to handle imports made from cythonized extensions.
hiddenimports = collect_submodules('dbus_fast')

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for dclab: https://pypi.python.org/pypi/dclab
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('dclab')

View File

@@ -0,0 +1,14 @@
# ------------------------------------------------------------------
# Copyright (c) 2023 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Collect source .py files for JIT/torchscript. Requires PyInstaller >= 5.3, no-op in older versions.
module_collection_mode = 'pyz+py'

View File

@@ -0,0 +1,40 @@
# ------------------------------------------------------------------
# Copyright (c) 2022 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
import os
from PyInstaller.utils.hooks import get_module_attribute, logger
from PyInstaller.depend.utils import _resolveCtypesImports
binaries = []
# Use the _LIB_NAME attribute of discid.libdiscid to resolve the shared library name. This saves us from having to
# duplicate the name guessing logic from discid.libdiscid.
# On error, PyInstaller >= 5.0 raises exception, earlier versions return an empty string.
try:
lib_name = get_module_attribute("discid.libdiscid", "_LIB_NAME")
except Exception:
lib_name = None
if lib_name:
lib_name = os.path.basename(lib_name)
try:
resolved_binary = _resolveCtypesImports([lib_name])
lib_file = resolved_binary[0][1]
except Exception as e:
lib_file = None
logger.warning("Error while trying to resolve %s: %s", lib_name, e)
if lib_file:
binaries += [(lib_file, '.')]
else:
logger.warning("Failed to determine name of libdiscid shared library from _LIB_NAME attribute of discid.libdiscid!")

View File

@@ -0,0 +1,19 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# Hook for the diStorm3 module: https://pypi.python.org/pypi/distorm3
# Tested with distorm3 3.3.0, Python 2.7, Windows
from PyInstaller.utils.hooks import collect_dynamic_libs
# distorm3 dynamic library should be in the path with other dynamic libraries.
binaries = collect_dynamic_libs('distorm3', destdir='.')

View File

@@ -0,0 +1,29 @@
#-----------------------------------------------------------------------------
# Copyright (c) 2025, PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
#-----------------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
# Collect submodules of distributed.http, many of which are imported indirectly.
hiddenimports = collect_submodules("distributed.http")
# Collect data files (distributed.yaml, distributed-schema.yaml, templates).
datas = collect_data_files("distributed")
# `distributed.dashboard.components.scheduler` attempts to refer to data files relative to its parent directory, but
# with non-normalized '..' elements in the path (e.g., `_MEIPASS/distributed/dashboard/components/../theme.yaml`). On
# POSIX systems, such paths are treated as non-existent if a component does not exist, even if the file exists at the
# normalized location (i.e., if `_MEIPASS/distributed/dashboard/theme.yaml` file exists but
# `_MEIPASS/distributed/dashboard/components` directory does not). As a work around, collect source .py files from
# `distributed.dashboard.components` to ensure existence of the `components` directory.
module_collection_mode = {
'distributed.dashboard.components': 'pyz+py',
}

View File

@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# This is hook for DNS python package dnspython.
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('dns.rdtypes')

View File

@@ -0,0 +1,19 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
hiddenimports = (collect_submodules('docutils.languages') +
collect_submodules('docutils.writers') +
collect_submodules('docutils.parsers.rst.languages') +
collect_submodules('docutils.parsers.rst.directives'))
datas = collect_data_files('docutils')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files("docx")

View File

@@ -0,0 +1,18 @@
# ------------------------------------------------------------------
# Copyright (c) 2021 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later.
# ------------------------------------------------------------------
# Hook for docx2pdf: https://pypi.org/project/docx2pdf/
from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata('docx2pdf')
datas += collect_data_files('docx2pdf')

View File

@@ -0,0 +1,22 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import copy_metadata, is_module_satisfies
# duckdb requires stdlib `inspect` module. On newer python versions (>= 3.10), it is collected as a dependency of other
# stdlib modules, while on older python versions this is not the case. Therefore, we add it to hidden imports regardless
# of python version.
hiddenimports = ['inspect']
# Starting with v1.4.0, `duckdb` uses `importlib.metadata.version()` to determine its version.
if is_module_satisfies("duckdb >= 1.4.0"):
datas = copy_metadata('duckdb')

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
hiddenimports = ['dynaconf.loaders.env_loader',
'dynaconf.loaders.redis_loader',
'dynaconf.loaders.vault.loader']

View File

@@ -0,0 +1,18 @@
from PyInstaller.utils.hooks import collect_data_files, get_hook_config
# Recognition backends are imported with `importlib.import_module()`.
hiddenimports = ['easyocr.model.vgg_model', 'easyocr.model.model']
def hook(hook_api):
lang_codes = get_hook_config(hook_api, 'easyocr', 'lang_codes')
if not lang_codes:
lang_codes = ['*']
extra_datas = list()
extra_datas += collect_data_files('easyocr', include_py_files=False, subdir='character',
includes=[f'{lang_code}_char.txt' for lang_code in lang_codes])
extra_datas += collect_data_files('easyocr', include_py_files=False, subdir='dict',
includes=[f'{lang_code}.txt' for lang_code in lang_codes])
hook_api.add_datas(extra_datas)

View File

@@ -0,0 +1,20 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_dynamic_libs
# Collect bundled dynamic libraries.
binaries = collect_dynamic_libs('eccodeslib')
# `eccodeslib` depends on `eckitlib` and `fckitlib`, and when libraries are being imported at run-time by
# `findlibs.find()` user warnings are emitted if these packages cannot be imported.
hiddenimports = ['eckitlib', 'fckitlib']

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_dynamic_libs
# Collect bundled dynamic libraries.
binaries = collect_dynamic_libs('eckitlib')

View File

@@ -0,0 +1,16 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('eel')
hiddenimports = ['bottle_websocket']

View File

@@ -0,0 +1,15 @@
# ------------------------------------------------------------------
# Copyright (c) 2025 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('emoji')

Some files were not shown because too many files have changed in this diff Show More