Remove hardcoded libpython binaries and add debug step
All checks were successful
build / build-linux (push) Successful in 16s
All checks were successful
build / build-linux (push) Successful in 16s
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# ------------------------------------------------------------------
|
||||
# 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
|
||||
|
||||
__version__ = '2025.10'
|
||||
__maintainer__ = 'Legorooj, bwoodsend'
|
||||
__uri__ = 'https://github.com/pyinstaller/pyinstaller-hooks-contrib'
|
||||
|
||||
|
||||
def get_hook_dirs():
|
||||
import os
|
||||
hooks_dir = os.path.dirname(__file__)
|
||||
return [
|
||||
# Required because standard hooks are in sub-directory instead of the top-level hooks directory.
|
||||
os.path.join(hooks_dir, 'stdhooks'),
|
||||
# pre_* and run-time hooks
|
||||
hooks_dir,
|
||||
]
|
||||
|
||||
|
||||
# Several packages for which provide hooks are involved in deep dependency chains when various optional dependencies are
|
||||
# installed in the environment, and their analysis typically requires recursion limit that exceeds the default 1000.
|
||||
# Therefore, automatically raise the recursion limit to at least 5000. This alleviates the need to do so on per-hook
|
||||
# basis.
|
||||
if (sys.platform.startswith('win') or sys.platform == 'cygwin') and sys.version_info < (3, 11):
|
||||
# The recursion limit test in PyInstaller main repository seems to push the recursion level to the limit; and if the
|
||||
# limit is set to 5000, this crashes python 3.8 - 3.10 on Windows and 3.9 that is (at the time of writing) available
|
||||
# under Cygwin. Further investigation revealed that Windows builds of python 3.8 and 3.10 handle recursion up to
|
||||
# level ~2075, while the practical limit for 3.9 is between 1950 and 1975. Therefore, for affected combinations of
|
||||
# platforms and python versions, use a conservative limit of 1900 - if only to avoid issues with the recursion limit
|
||||
# test in the main PyInstaller repository...
|
||||
new_recursion_limit = 1900
|
||||
else:
|
||||
new_recursion_limit = 5000
|
||||
|
||||
if sys.getrecursionlimit() < new_recursion_limit:
|
||||
sys.setrecursionlimit(new_recursion_limit)
|
||||
@@ -0,0 +1,42 @@
|
||||
# ------------------------------------------------------------------
|
||||
# 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
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
|
||||
from PyInstaller.utils.hooks import is_module_satisfies
|
||||
|
||||
|
||||
if is_module_satisfies("PyInstaller >= 6.0"):
|
||||
# PyInstaller >= 6.0 imports importlib_metadata in its compat module
|
||||
from PyInstaller.compat import importlib_metadata
|
||||
else:
|
||||
# Older PyInstaller version - duplicate logic from PyInstaller 6.0
|
||||
class ImportlibMetadataError(SystemExit):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
"pyinstaller-hooks-contrib requires importlib.metadata from python >= 3.10 stdlib or "
|
||||
"importlib_metadata from importlib-metadata >= 4.6"
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
import importlib.metadata as importlib_metadata
|
||||
else:
|
||||
try:
|
||||
import importlib_metadata
|
||||
except ImportError as e:
|
||||
raise ImportlibMetadataError() from e
|
||||
|
||||
import packaging.version # For importlib_metadata version check
|
||||
|
||||
# Validate the version
|
||||
if packaging.version.parse(importlib_metadata.version("importlib-metadata")) < packaging.version.parse("4.6"):
|
||||
raise ImportlibMetadataError()
|
||||
@@ -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
|
||||
# ------------------------------------------------------------------
|
||||
@@ -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
|
||||
# ------------------------------------------------------------------
|
||||
@@ -0,0 +1,28 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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 is_module_satisfies
|
||||
|
||||
|
||||
def pre_safe_import_module(api):
|
||||
# As of tensorflow 2.8.0, the `tensorflow.keras` is entirely gone, replaced by a lazy-loaded alias for
|
||||
# `keras.api._v2.keras`. Without us registering the alias here, a program that imports only from
|
||||
# `tensorflow.keras` fails to collect `tensorflow`.
|
||||
# See: https://github.com/pyinstaller/pyinstaller/discussions/6890
|
||||
# The alias was already present in earlier releases, but it does not seem to be causing problems there,
|
||||
# so keep this specific to tensorflow >= 2.8.0 to avoid accidentally breaking something else.
|
||||
#
|
||||
# Starting with tensorflow 2.16.0, the alias points to `keras._tf_keras.keras`.
|
||||
if is_module_satisfies("tensorflow >= 2.16.0"):
|
||||
api.add_alias_module('keras._tf_keras.keras', 'tensorflow.keras')
|
||||
elif is_module_satisfies("tensorflow >= 2.8.0"):
|
||||
api.add_alias_module('keras.api._v2.keras', 'tensorflow.keras')
|
||||
@@ -0,0 +1,46 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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
|
||||
#-----------------------------------------------------------------------------
|
||||
"""
|
||||
PyWin32 package 'win32com' extends it's __path__ attribute with win32comext
|
||||
directory and thus PyInstaller is not able to find modules in it. For example
|
||||
module 'win32com.shell' is in reality 'win32comext.shell'.
|
||||
|
||||
>>> win32com.__path__
|
||||
['win32com', 'C:\\Python27\\Lib\\site-packages\\win32comext']
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from PyInstaller.utils.hooks import logger, exec_statement
|
||||
from PyInstaller.compat import is_win, is_cygwin
|
||||
|
||||
|
||||
def pre_safe_import_module(api):
|
||||
if not (is_win or is_cygwin):
|
||||
return
|
||||
win32com_file = exec_statement(
|
||||
"""
|
||||
try:
|
||||
from win32com import __file__
|
||||
print(__file__)
|
||||
except Exception:
|
||||
pass
|
||||
""").strip()
|
||||
if not win32com_file:
|
||||
logger.debug('win32com: module not available')
|
||||
return # win32com unavailable
|
||||
win32com_dir = os.path.dirname(win32com_file)
|
||||
comext_dir = os.path.join(os.path.dirname(win32com_dir), 'win32comext')
|
||||
logger.debug('win32com: extending __path__ with dir %r' % comext_dir)
|
||||
# Append the __path__ where PyInstaller will look for 'win32com' modules.'
|
||||
api.append_package_path(comext_dir)
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
'cryptography': ['pyi_rth_cryptography_openssl.py'],
|
||||
'enchant': ['pyi_rth_enchant.py'],
|
||||
'findlibs': ['pyi_rth_findlibs.py'],
|
||||
'ffpyplayer': ['pyi_rth_ffpyplayer.py'],
|
||||
'osgeo': ['pyi_rth_osgeo.py'],
|
||||
'traitlets': ['pyi_rth_traitlets.py'],
|
||||
'usb': ['pyi_rth_usb.py'],
|
||||
'nltk': ['pyi_rth_nltk.py'],
|
||||
'pyproj': ['pyi_rth_pyproj.py'],
|
||||
'pygraphviz': ['pyi_rth_pygraphviz.py'],
|
||||
'pythoncom': ['pyi_rth_pythoncom.py'],
|
||||
'pyqtgraph': ['pyi_rth_pyqtgraph_multiprocess.py'],
|
||||
'pywintypes': ['pyi_rth_pywintypes.py'],
|
||||
'tensorflow': ['pyi_rth_tensorflow.py'],
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# ------------------------------------------------------------------
|
||||
# Copyright (c) 2020 PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# ------------------------------------------------------------------
|
||||
@@ -0,0 +1,20 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2024, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# If we collected OpenSSL modules into `ossl-modules` directory, override the OpenSSL search path by setting the
|
||||
# `OPENSSL_MODULES` environment variable.
|
||||
_ossl_modules_dir = os.path.join(sys._MEIPASS, 'ossl-modules')
|
||||
if os.path.isdir(_ossl_modules_dir):
|
||||
os.environ['OPENSSL_MODULES'] = _ossl_modules_dir
|
||||
del _ossl_modules_dir
|
||||
@@ -0,0 +1,22 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2005-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# On Mac OS X tell enchant library where to look for enchant backends (aspell, myspell, ...).
|
||||
# Enchant is looking for backends in directory 'PREFIX/lib/enchant'
|
||||
# Note: env. var. ENCHANT_PREFIX_DIR is implemented only in the development version:
|
||||
# https://github.com/AbiWord/enchant
|
||||
# https://github.com/AbiWord/enchant/pull/2
|
||||
# TODO Test this rthook.
|
||||
if sys.platform.startswith('darwin'):
|
||||
os.environ['ENCHANT_PREFIX_DIR'] = os.path.join(sys._MEIPASS, 'enchant')
|
||||
@@ -0,0 +1,19 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2023, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Starting with v4.3.5, the `ffpyplayer` package attempts to use `site.USER_BASE` in path manipulation functions.
|
||||
# As frozen application runs with disabled `site`, the value of this variable is `None`, and causes path manipulation
|
||||
# functions to raise an error. As a work-around, we set `site.USER_BASE` to an empty string, which is also what the
|
||||
# fake `site` module available in PyInstaller prior to v5.5 did.
|
||||
import site
|
||||
|
||||
if site.USER_BASE is None:
|
||||
site.USER_BASE = ''
|
||||
@@ -0,0 +1,58 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2024, PyInstaller Development Team.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
#
|
||||
# The full license is in the file COPYING.txt, distributed with this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Override the findlibs.find() function to give precedence to sys._MEIPASS, followed by `ctypes.util.find_library`,
|
||||
# and only then the hard-coded paths from the original implementation. The main aim here is to avoid loading libraries
|
||||
# from Homebrew environment on macOS when it happens to be present at run-time and we have a bundled copy collected from
|
||||
# the build system. This happens because we (try not to) modify `DYLD_LIBRARY_PATH`, and the original `findlibs.find()`
|
||||
# implementation gives precedence to environment variables and several fixed/hard-coded locations, and uses
|
||||
# `ctypes.util.find_library` as the final fallback...
|
||||
def _pyi_rthook():
|
||||
import sys
|
||||
import os
|
||||
import ctypes.util
|
||||
|
||||
# findlibs v0.1.0 broke compatibility with python < 3.10; due to incompatible typing annotation, attempting to
|
||||
# import the package raises `TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'`. Gracefully
|
||||
# handle this situation by making this run-time hook no-op, in order to avoid crashing the frozen program even
|
||||
# if it would never end up importing/using `findlibs`.
|
||||
try:
|
||||
import findlibs
|
||||
except TypeError:
|
||||
return
|
||||
|
||||
_orig_find = getattr(findlibs, 'find', None)
|
||||
|
||||
def _pyi_find(lib_name, *args, **kwargs):
|
||||
extension = findlibs.EXTENSIONS.get(sys.platform, ".so")
|
||||
|
||||
# First check sys._MEIPASS
|
||||
fullname = os.path.join(sys._MEIPASS, "lib{}{}".format(lib_name, extension))
|
||||
if os.path.isfile(fullname):
|
||||
return fullname
|
||||
|
||||
# Fall back to `ctypes.util.find_library` (to give it precedence over hard-coded paths from original
|
||||
# implementation).
|
||||
lib = ctypes.util.find_library(lib_name)
|
||||
if lib is not None:
|
||||
return lib
|
||||
|
||||
# Finally, fall back to original implementation
|
||||
if _orig_find is not None:
|
||||
return _orig_find(lib_name, *args, **kwargs)
|
||||
|
||||
return None
|
||||
|
||||
findlibs.find = _pyi_find
|
||||
|
||||
|
||||
_pyi_rthook()
|
||||
del _pyi_rthook
|
||||
@@ -0,0 +1,17 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2013-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
import nltk
|
||||
|
||||
#add the path to nltk_data
|
||||
nltk.data.path.insert(0, os.path.join(sys._MEIPASS, "nltk_data"))
|
||||
@@ -0,0 +1,32 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2015-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Installing `osgeo` Conda packages requires to set `GDAL_DATA`
|
||||
|
||||
is_win = sys.platform.startswith('win')
|
||||
if is_win:
|
||||
|
||||
gdal_data = os.path.join(sys._MEIPASS, 'data', 'gdal')
|
||||
if not os.path.exists(gdal_data):
|
||||
|
||||
gdal_data = os.path.join(sys._MEIPASS, 'Library', 'share', 'gdal')
|
||||
# last attempt, check if one of the required file is in the generic folder Library/data
|
||||
if not os.path.exists(os.path.join(gdal_data, 'gcs.csv')):
|
||||
gdal_data = os.path.join(sys._MEIPASS, 'Library', 'data')
|
||||
|
||||
else:
|
||||
gdal_data = os.path.join(sys._MEIPASS, 'share', 'gdal')
|
||||
|
||||
if os.path.exists(gdal_data):
|
||||
os.environ['GDAL_DATA'] = gdal_data
|
||||
@@ -0,0 +1,32 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2021, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import pygraphviz
|
||||
|
||||
# Override pygraphviz.AGraph._which method to search for graphviz executables inside sys._MEIPASS
|
||||
if hasattr(pygraphviz.AGraph, '_which'):
|
||||
|
||||
def _pygraphviz_override_which(self, name):
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
program_name = name
|
||||
if platform.system() == "Windows":
|
||||
program_name += ".exe"
|
||||
|
||||
program_path = os.path.join(sys._MEIPASS, program_name)
|
||||
if not os.path.isfile(program_path):
|
||||
raise ValueError(f"Prog {name} not found in the PyInstaller-frozen application bundle!")
|
||||
|
||||
return program_path
|
||||
|
||||
pygraphviz.AGraph._which = _pygraphviz_override_which
|
||||
@@ -0,0 +1,26 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2015-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Installing `pyproj` Conda packages requires to set `PROJ_LIB`
|
||||
|
||||
is_win = sys.platform.startswith('win')
|
||||
if is_win:
|
||||
|
||||
proj_data = os.path.join(sys._MEIPASS, 'Library', 'share', 'proj')
|
||||
|
||||
else:
|
||||
proj_data = os.path.join(sys._MEIPASS, 'share', 'proj')
|
||||
|
||||
if os.path.exists(proj_data):
|
||||
os.environ['PROJ_LIB'] = proj_data
|
||||
@@ -0,0 +1,52 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2022, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def _setup_pyqtgraph_multiprocess_hook():
|
||||
# NOTE: pyqtgraph.multiprocess spawns the sub-process using subprocess.Popen (or equivalent). This means that in
|
||||
# onefile builds, the executable in subprocess will unpack itself again, into different sys._MEIPASS, because
|
||||
# the _MEIPASS2 environment variable is not set (bootloader / bootstrap script cleans it up). This will make the
|
||||
# argv[1] check below fail, due to different sys._MEIPASS value in the subprocess.
|
||||
#
|
||||
# To work around this, at the time of writing (PyInstaller 5.5), the user needs to set _MEIPASS2 environment
|
||||
# variable to sys._MEIPASS before using `pyqtgraph.multiprocess` in onefile builds. And stlib's
|
||||
# `multiprocessing.freeze_support` needs to be called in the entry-point program, due to `pyqtgraph.multiprocess`
|
||||
# internally using stdlib's `multiprocessing` primitives.
|
||||
if len(sys.argv) == 2 and sys.argv[1] == os.path.join(sys._MEIPASS, 'pyqtgraph', 'multiprocess', 'bootstrap.py'):
|
||||
# Load as module; this requires --hiddenimport pyqtgraph.multiprocess.bootstrap
|
||||
try:
|
||||
import importlib.util
|
||||
spec = importlib.util.find_spec("pyqtgraph.multiprocess.bootstrap")
|
||||
bootstrap_co = spec.loader.get_code("pyqtgraph.multiprocess.bootstrap")
|
||||
except Exception:
|
||||
bootstrap_co = None
|
||||
|
||||
if bootstrap_co:
|
||||
exec(bootstrap_co)
|
||||
sys.exit(0)
|
||||
|
||||
# Load from file; requires pyqtgraph/multiprocess/bootstrap.py collected as data file
|
||||
# This is obsolete for PyInstaller >= v6.10.0
|
||||
bootstrap_file = os.path.join(sys._MEIPASS, 'pyqtgraph', 'multiprocess', 'bootstrap.py')
|
||||
if os.path.isfile(bootstrap_file):
|
||||
with open(bootstrap_file, 'r') as fp:
|
||||
bootstrap_code = fp.read()
|
||||
exec(bootstrap_code)
|
||||
sys.exit(0)
|
||||
|
||||
raise RuntimeError("Could not find pyqtgraph.multiprocess bootstrap code or script!")
|
||||
|
||||
|
||||
_setup_pyqtgraph_multiprocess_hook()
|
||||
del _setup_pyqtgraph_multiprocess_hook
|
||||
@@ -0,0 +1,24 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2022, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Unfortunately, __import_pywin32_system_module__ from pywintypes module assumes that in a frozen application, the
|
||||
# pythoncom3X.dll and pywintypes3X.dll that are normally found in site-packages/pywin32_system32, are located
|
||||
# directly in the sys.path, without bothering to check first if they are actually available in the standard location.
|
||||
# This obviously runs afoul of our attempts at preserving the directory layout and placing them in the pywin32_system32
|
||||
# sub-directory instead of the top-level application directory. So as a work-around, add the sub-directory to sys.path
|
||||
# to keep pywintypes happy...
|
||||
import sys
|
||||
import os
|
||||
|
||||
pywin32_system32_path = os.path.join(sys._MEIPASS, 'pywin32_system32')
|
||||
if os.path.isdir(pywin32_system32_path) and pywin32_system32_path not in sys.path:
|
||||
sys.path.append(pywin32_system32_path)
|
||||
del pywin32_system32_path
|
||||
@@ -0,0 +1,24 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2022, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Unfortunately, __import_pywin32_system_module__ from pywintypes module assumes that in a frozen application, the
|
||||
# pythoncom3X.dll and pywintypes3X.dll that are normally found in site-packages/pywin32_system32, are located
|
||||
# directly in the sys.path, without bothering to check first if they are actually available in the standard location.
|
||||
# This obviously runs afoul of our attempts at preserving the directory layout and placing them in the pywin32_system32
|
||||
# sub-directory instead of the top-level application directory. So as a work-around, add the sub-directory to sys.path
|
||||
# to keep pywintypes happy...
|
||||
import sys
|
||||
import os
|
||||
|
||||
pywin32_system32_path = os.path.join(sys._MEIPASS, 'pywin32_system32')
|
||||
if os.path.isdir(pywin32_system32_path) and pywin32_system32_path not in sys.path:
|
||||
sys.path.append(pywin32_system32_path)
|
||||
del pywin32_system32_path
|
||||
@@ -0,0 +1,53 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2023, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
def _pyi_rthook():
|
||||
import sys
|
||||
|
||||
# `tensorflow` versions prior to 2.3.0 attempt to use `site.USER_SITE` in path/string manipulation functions.
|
||||
# As frozen application runs with disabled `site`, the value of this variable is `None`, and causes path/string
|
||||
# manipulation functions to raise an error. As a work-around, we set `site.USER_SITE` to an empty string, which is
|
||||
# also what the fake `site` module available in PyInstaller prior to v5.5 did.
|
||||
import site
|
||||
|
||||
if site.USER_SITE is None:
|
||||
site.USER_SITE = ''
|
||||
|
||||
# The issue described about with site.USER_SITE being None has largely been resolved in contemporary `tensorflow`
|
||||
# versions, which now check that `site.ENABLE_USER_SITE` is set and that `site.USER_SITE` is not None before
|
||||
# trying to use it.
|
||||
#
|
||||
# However, `tensorflow` will attempt to search and load its plugins only if it believes that it is running from
|
||||
# "a pip-based installation" - if the package's location is rooted in one of the "site-packages" directories. See
|
||||
# https://github.com/tensorflow/tensorflow/blob/6887368d6d46223f460358323c4b76d61d1558a8/tensorflow/api_template.__init__.py#L110C76-L156
|
||||
# Unfortunately, they "cleverly" infer the module's location via `inspect.getfile(inspect.currentframe())`, which
|
||||
# in the frozen application returns anonymized relative source file name (`tensorflow/__init__.py`) - so we need one
|
||||
# of the "site directories" to be just "tensorflow" (to fool the `_running_from_pip_package()` check), and we also
|
||||
# need `sys._MEIPASS` to be among them (to load the plugins from the actual `sys._MEIPASS/tensorflow-plugins`).
|
||||
# Therefore, we monkey-patch `site.getsitepackages` to add those two entries to the list of "site directories".
|
||||
|
||||
_orig_getsitepackages = getattr(site, 'getsitepackages', None)
|
||||
|
||||
def _pyi_getsitepackages():
|
||||
return [
|
||||
sys._MEIPASS,
|
||||
"tensorflow",
|
||||
*(_orig_getsitepackages() if _orig_getsitepackages is not None else []),
|
||||
]
|
||||
|
||||
site.getsitepackages = _pyi_getsitepackages
|
||||
|
||||
# NOTE: instead of the above override, we could also set TF_PLUGGABLE_DEVICE_LIBRARY_PATH, but that works only
|
||||
# for tensorflow >= 2.12.
|
||||
|
||||
|
||||
_pyi_rthook()
|
||||
del _pyi_rthook
|
||||
@@ -0,0 +1,25 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2005-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# 'traitlets' uses module 'inspect' from default Python library to inspect
|
||||
# source code of modules. However, frozen app does not contain source code
|
||||
# of Python modules.
|
||||
#
|
||||
# hook-IPython depends on module 'traitlets'.
|
||||
|
||||
import traitlets.traitlets
|
||||
|
||||
|
||||
def _disabled_deprecation_warnings(method, cls, method_name, msg):
|
||||
pass
|
||||
|
||||
|
||||
traitlets.traitlets._deprecated_method = _disabled_deprecation_warnings
|
||||
@@ -0,0 +1,85 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
# Copyright (c) 2013-2020, PyInstaller Development Team.
|
||||
#
|
||||
# This file is distributed under the terms of the Apache License 2.0
|
||||
#
|
||||
# The full license is available in LICENSE, distributed with
|
||||
# this software.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
import ctypes
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
# Pyusb changed these libusb module names in commit 2082e7.
|
||||
try:
|
||||
import usb.backend.libusb10 as libusb10
|
||||
except ImportError:
|
||||
import usb.backend.libusb1 as libusb10
|
||||
try:
|
||||
import usb.backend.libusb01 as libusb01
|
||||
except ImportError:
|
||||
import usb.backend.libusb0 as libusb01
|
||||
import usb.backend.openusb as openusb
|
||||
|
||||
|
||||
def get_load_func(type, candidates):
|
||||
|
||||
def _load_library(find_library=None):
|
||||
exec_path = sys._MEIPASS
|
||||
|
||||
library = None
|
||||
for candidate in candidates:
|
||||
|
||||
# Find a list of library files that match 'candidate'.
|
||||
if find_library:
|
||||
# Caller provides a function that lookup lib path by candidate name.
|
||||
lib_path = find_library(candidate)
|
||||
libs = [lib_path] if lib_path else []
|
||||
else:
|
||||
# No find_library callback function, we look at the default location.
|
||||
if os.name == 'posix' and sys.platform == 'darwin':
|
||||
libs = glob.glob("%s/%s*.dylib*" % (exec_path, candidate))
|
||||
elif sys.platform == 'win32' or sys.platform == 'cygwin':
|
||||
libs = glob.glob("%s\\%s*.dll" % (exec_path, candidate))
|
||||
else:
|
||||
libs = glob.glob("%s/%s*.so*" % (exec_path, candidate))
|
||||
|
||||
# Do linker's path lookup work to force load bundled copy.
|
||||
for libname in libs:
|
||||
try:
|
||||
# NOTE: libusb01 is using CDLL under win32.
|
||||
# (see usb.backends.libusb01)
|
||||
if sys.platform == 'win32' and type != 'libusb01':
|
||||
library = ctypes.WinDLL(libname)
|
||||
else:
|
||||
library = ctypes.CDLL(libname)
|
||||
if library is not None:
|
||||
break
|
||||
except OSError:
|
||||
library = None
|
||||
if library is not None:
|
||||
break
|
||||
else:
|
||||
raise OSError('USB library could not be found')
|
||||
|
||||
if type == 'libusb10':
|
||||
if not hasattr(library, 'libusb_init'):
|
||||
raise OSError('USB library could not be found')
|
||||
return library
|
||||
|
||||
return _load_library
|
||||
|
||||
|
||||
# NOTE: Need to keep in sync with future PyUSB updates.
|
||||
if sys.platform == 'cygwin':
|
||||
libusb10._load_library = get_load_func('libusb10', ('cygusb-1.0', ))
|
||||
libusb01._load_library = get_load_func('libusb01', ('cygusb0', ))
|
||||
openusb._load_library = get_load_func('openusb', ('openusb', ))
|
||||
else:
|
||||
libusb10._load_library = get_load_func('libusb10', ('usb-1.0', 'libusb-1.0', 'usb'))
|
||||
libusb01._load_library = get_load_func('libusb01', ('usb-0.1', 'usb', 'libusb0', 'libusb'))
|
||||
openusb._load_library = get_load_func('openusb', ('openusb', ))
|
||||
@@ -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
|
||||
# ------------------------------------------------------------------
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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
|
||||
@@ -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('.', '/')))
|
||||
@@ -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')
|
||||
@@ -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)
|
||||
@@ -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')
|
||||
@@ -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',
|
||||
]
|
||||
@@ -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")
|
||||
@@ -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')
|
||||
@@ -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']
|
||||
@@ -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']
|
||||
@@ -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')
|
||||
@@ -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']
|
||||
@@ -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']
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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")
|
||||
@@ -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']
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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']
|
||||
@@ -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)
|
||||
@@ -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')
|
||||
@@ -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"]
|
||||
@@ -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')
|
||||
@@ -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'))
|
||||
@@ -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']
|
||||
@@ -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")
|
||||
@@ -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']
|
||||
@@ -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"),
|
||||
]
|
||||
@@ -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")
|
||||
@@ -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']
|
||||
@@ -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']
|
||||
@@ -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)
|
||||
@@ -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']
|
||||
@@ -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'
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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]
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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'}
|
||||
@@ -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!")
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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/**'])
|
||||
@@ -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',
|
||||
]
|
||||
@@ -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"]
|
||||
@@ -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"]
|
||||
@@ -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')
|
||||
@@ -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"]
|
||||
@@ -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")
|
||||
@@ -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")
|
||||
@@ -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/**'])
|
||||
@@ -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",
|
||||
]
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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.")
|
||||
@@ -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')
|
||||
@@ -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")
|
||||
@@ -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')
|
||||
]
|
||||
@@ -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']
|
||||
@@ -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']
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
@@ -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')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user