Example #1
0
def _collect_python_stdlib_dynamic_libraries():
    """
    Collect all of the standard library(most of it) dynamic libraries.
    """
    _dynamic_libs = set()

    stdlib = _python_stdlib_path()
    if not stdlib.exists():
        log.error("The path '%s' does not exist", stdlib)
        return list(_dynamic_libs)

    log.info(
        "Collecting dynamic libraries from the python standard library at: %s",
        stdlib,
    )
    for path in stdlib.glob("*"):
        if not path.is_dir():
            continue
        if path.name in (
                "__pycache__",
                "site-packages",
                "test",
                "turtledemo",
                "ensurepip",
        ):
            continue
        if path.joinpath("__init__.py").is_file():
            log.info("Collecting: %s", path.name)
            try:
                _module_dynamic_libs = hooks.collect_dynamic_libs(
                    path.name, path.name)
                log.debug("Collected(%s): %s", path.name, _module_dynamic_libs)
                _dynamic_libs.update(set(_module_dynamic_libs))
            except Exception as exc:  # pylint: disable=broad-except
                log.error("Failed to collect %r: %s", path.name, exc)
    log.info("Collected stdlib dynamic libs: %s", sorted(_dynamic_libs))
    return sorted(_dynamic_libs)
Example #2
0
# ------------------------------------------------------------------
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.compat import is_pure_conda
from PyInstaller.utils.hooks import collect_dynamic_libs, conda

binaries = collect_dynamic_libs('rtree', destdir='rtree/lib')
if not binaries and is_pure_conda:
    binaries = conda.collect_dynamic_libs('libspatialindex',
                                          dest='rtree/lib',
                                          dependencies=False)
Example #3
0
# -----------------------------------------------------------------------------
# Copyright (c) 2013-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------------------------------------
#
# A lightweight LLVM python binding for writing JIT compilers
# https://github.com/numba/llvmlite
#
# Tested with:
# llvmlite 0.11 (Anaconda 4.1.1, Windows), llvmlite 0.13 (Linux)

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs("llvmlite")
Example #4
0
#-----------------------------------------------------------------------------
# Based on examples at https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/hooks/
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_dynamic_libs, collect_data_files, exec_statement, copy_metadata,\
    collect_submodules, get_package_paths
import os.path

(_, obspy_root) = get_package_paths('obspy')

binaries = collect_dynamic_libs('obspy')
datas = [
    # Dummy path, this needs to exist for obspy.core.util.libnames._load_cdll
    (os.path.join(obspy_root, "*.txt"), os.path.join('obspy', 'core', 'util')),
    # Data
    (os.path.join(obspy_root, "imaging",
                  "data"), os.path.join('obspy', 'imaging', 'data')),
    (os.path.join(obspy_root, "taup",
                  "data"), os.path.join('obspy', 'taup', 'data')),
    (os.path.join(obspy_root, "geodetics",
                  "data"), os.path.join('obspy', 'geodetics', 'data')),
]

# Plugins are defined in the metadata (.egg-info) directory, but if we grab the whole thing it causes
# other errors, so include only entry_points.txt
metadata = copy_metadata('obspy')
egg = metadata[0]
if '.egg' not in egg[0]:
    raise Exception("Unexpected metadata: %s" % (metadata, ))
# Specify the source as just the entry points file
metadata = [(os.path.join(egg[0], 'entry_points.txt'), egg[1])]
Example #5
0
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------

# Hook for https://pypi.org/project/pyarrow/

from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs

hiddenimports = [
    "pyarrow._parquet",
    "pyarrow.lib",
    "pyarrow.compat",
]

datas = collect_data_files('pyarrow')
binaries = collect_dynamic_libs('pyarrow')
Example #6
0
    global datas
    res_path = os.path.join(pygame_folder, file_path)
    if os.path.exists(res_path):
        datas.append((res_path, "pygame"))


# First append the font file, then based on the OS, append pygame icon file
_append_to_datas("freesansbold.ttf")
if platform.system() == "Darwin":
    _append_to_datas("pygame_icon.tiff")
else:
    _append_to_datas("pygame_icon.bmp")

if platform.system() == "Windows":
    from PyInstaller.utils.hooks import collect_dynamic_libs

    pre_binaries = collect_dynamic_libs('pygame')
    binaries = []

    for b in pre_binaries:
        binary, location = b

        filename = os.path.split(binary)[-1]
        if filename.removesuffix('.dll') in exclude_bin:
            print('Custom pygame hook excluding binary:', filename)
            continue

        # settles all the DLLs into the top level folder, which prevents duplication
        # with the DLLs already being put there.
        binaries.append((binary, "."))
# ------------------------------------------------------------------
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
Hook for https://github.com/libtcod/python-tcod
"""
from PyInstaller.utils.hooks import collect_dynamic_libs

hiddenimports = ['_cffi_backend']

# Install shared libraries to the working directory.
binaries = collect_dynamic_libs('tcod', destdir='.')
# ------------------------------------------------------------------
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

# hook for https://pypi.org/project/python-magic-bin

from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs

datas = collect_data_files('magic')
binaries = collect_dynamic_libs('magic')
from PyInstaller.utils.hooks import collect_submodules, collect_dynamic_libs
hiddenimports = collect_submodules('statsmodels')
binaries = collect_dynamic_libs('statsmodels')
Example #10
0
#-----------------------------------------------------------------------------
# Copyright (c) 2016-2017, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

"""
Libaudioverse: https://github.com/libaudioverse/libaudioverse
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('libaudioverse')
Example #11
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2017, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#
# A lightweight LLVM python binding for writing JIT compilers
# https://github.com/numba/llvmlite
#
# Tested with:
# llvmlite 0.11 (Anaconda 4.1.1, Windows), llvmlite 0.13 (Linux)

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs("llvmlite")
#-----------------------------------------------------------------------------
# Copyright (c) 2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

"""
accessible_output2: http://hg.q-continuum.net/accessible_output2
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('accessible_output2')
Example #13
0
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------


"""
Hook for PyZMQ. Cython based Python bindings for messaging library ZeroMQ.
http://www.zeromq.org/
"""
from PyInstaller.utils.hooks import collect_dynamic_libs, collect_submodules

hiddenimports = ['zmq.utils.garbage']
hiddenimports.extend(collect_submodules('zmq.backend'))

# If PyZMQ provides its own copy of libzmq or libsodium, add it to the
# extension-modules TOC so zmq/__init__.py can load it at runtime.
# For predictable behavior, the libzmq search here must be equivalent
# to the search in zmq/__init__.py.
# zmq/__init__.py will look in os.join(sys._MEIPASS, 'zmq'),
# so libzmq has to land there.
binaries = collect_dynamic_libs('zmq')
Example #14
0
    for mod in HIDDEN_IMPORTS[:]:
        if mod == sloader:
            continue
        if mod.startswith(mod):
            LOADER_MODULES_SOURCES.append(mod.replace('.', os.sep))

# Let's remove any python source files included that are in HIDDEN_IMPORTS but not on DATAS
for entry in DATAS[:]:
    path, mod = entry
    if not path.endswith(tuple(PY_EXECUTABLE_SUFFIXES)):
        # We are only after python files
        continue
    no_ext_path = os.path.splitext(path)[0]
    if not no_ext_path.endswith(tuple(LOADER_MODULES_SOURCES)):
        if entry in DATAS:
            DATAS.remove(entry)

# Some packages salt required, which we should include that are not discovered by PyInstaller
PACKAGES = []

for pkg in PACKAGES:
    DATAS.extend(collect_data_files(pkg, include_py_files=True))
    BINARIES.extend(collect_dynamic_libs(pkg))
    HIDDEN_IMPORTS.extend(collect_submodules(pkg))

DATAS.extend(collect_data_files('hubblestack', subdir=".", include_py_files=True))
# Finally, define the globals that PyInstaller expects
hiddenimports = HIDDEN_IMPORTS
datas = DATAS
binaries = BINARIES
Example #15
0
# Collect dynamic library from the solver - it is not automatically
# detected since the library is not built as python extension
from PyInstaller.utils.hooks import collect_dynamic_libs
binaries = collect_dynamic_libs('pyzceqsolver')
Example #16
0
#-----------------------------------------------------------------------------
# Copyright (c) 2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

"""
sound_lib: http://hg.q-continuum.net/sound_lib
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('sound_lib')
Example #17
0
from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs("pyogg")
Example #18
0
hiddenimports = collect_submodules(PACKAGE_NAME)


# datas
datas = collect_data_files(PACKAGE_NAME)

# add repository level assets.
# application level assets should be located in the package
# and accessed via importlib.resources
datas.extend([
    ('docs/build', 'docs/build'),
])

# log
logger.info("")
logger.info(f"Collected data files for {PACKAGE_NAME}:")
for source, destination in datas:
    msg = f"{source} {destination}"
    logger.info(msg)


# binaries
binaries = collect_dynamic_libs(PACKAGE_NAME)

# log
logger.info("")
logger.info(f"Found binaries for {PACKAGE_NAME}")
for source, destination in binaries:
    msg = f"{source} {destination}"
    logger.info(msg)
Example #19
0
# ------------------------------------------------------------------
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs("tableauhyperapi")
Example #20
0
                else:
                    name = os.path.join(dir_prefix, fName)
                res += [(os.path.join(fold, fName), name)]
    return res


def _my_collect_data_files(modname, flatten_dirs=False, **kwargs):
    files = collect_data_files(modname, **kwargs)
    if flatten_dirs:
        # files = [(source, os.path.split(dest)[0])for source, dest in files]
        files = [(source, ".") for source, dest in files]

    return files


if __name__ == '__main__':

    print(_module_path("pyopencl"))
    print(_module_path("gputools"))
    print(_module_path("PyQt5"))

    # print _get_toc_objects(os.path.join(_module_path("pyopencl"), "cl"),
    #                    dir_prefix = "pyopencl/cl")

    print(collect_dynamic_libs("PyQt5"))
    print(collect_dynamic_libs("pyopencl"))

    # print _my_collect_data_files("pyopencl", include_py_files = True)
    # print _my_collect_data_files("gputools")
    print(_my_collect_data_files("gputools", flatten_dirs=True))
#-----------------------------------------------------------------------------
# Copyright (c) 2016-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------
"""
sound_lib: http://hg.q-continuum.net/sound_lib
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('sound_lib')
Example #22
0
for entry in DATAS[:]:
    path, mod = entry
    if not path.endswith(('.py', '.pyc')):
        # We are only after python files
        continue
    no_ext_path = os.path.splitext(path)[0]
    if not no_ext_path.endswith(tuple(LOADER_MODULES_SOURCES)):
        if entry in DATAS:
            DATAS.remove(entry)

# Some packages salt required, which we should include that are not discovered by PyInstaller
PACKAGES = []

for pkg in PACKAGES:
    DATAS.extend(collect_data_files(pkg, include_py_files=True))
    BINARIES.extend(collect_dynamic_libs(pkg))
    HIDDEN_IMPORTS.extend(collect_submodules(pkg))

DATAS.extend(
    collect_data_files('hubblestack', subdir=".", include_py_files=True))
# Finally, define the globals that PyInstaller expects
hiddenimports = HIDDEN_IMPORTS
datas = DATAS
binaries = BINARIES


def _patch_salt_grains_core_server_id():
    import salt.config  # must import before salt.grains.core
    import salt.grains.core
    import sys
    import patch
Example #23
0
# ------------------------------------------------------------------
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
"""
sound_lib: http://hg.q-continuum.net/sound_lib
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

datas = collect_dynamic_libs('sound_lib')
from PyInstaller.utils.hooks import collect_submodules, collect_dynamic_libs
hiddenimports = collect_submodules('scipy')
binaries = collect_dynamic_libs('scipy')
Example #25
0
needs.

Our (some-what inadequate) docs for writing PyInstaller hooks are kept here:
https://pyinstaller.readthedocs.io/en/stable/hooks.html

PyInstaller has a lot of NumPy users so we'd consider maintaining this hook to
be high priority. Feel free to @mention either bwoodsend or Legorooj on Github
for help keeping it working.
"""

from PyInstaller.utils.hooks import collect_dynamic_libs
from PyInstaller.compat import is_conda, is_pure_conda

# Collect all DLLs inside numpy's installation folder, dump them into built
# app's root.
binaries = collect_dynamic_libs("numpy", ".")

# If using Conda without any non-conda virtual environment manager:
if is_pure_conda:
    # Assume running the NumPy from Conda-forge and collect it's DLLs from the
    # communal Conda bin directory. DLLs from NumPy's dependencies must also be
    # collected to capture MKL, OpenBlas, OpenMP, etc.
    from PyInstaller.utils.hooks import conda_support
    datas = conda_support.collect_dynamic_libs("numpy", dependencies=True)

# Submodules PyInstaller can't detect (probably because they're only imported
# by extension modules which PyInstaller can't read).
hiddenimports = ['numpy.core._dtype_ctypes']
if is_conda:
    hiddenimports.append("six")
Example #26
0
from PyInstaller.utils.hooks import collect_dynamic_libs

hiddenimports = ["_cffi_backend"]

# Install shared libraries to the working directory.
binaries = collect_dynamic_libs("tcod", destdir=".")
Example #27
0
                res += [(os.path.join(fold,fName), name)]
    return res

def _my_collect_data_files(modname, flatten_dirs = False, **kwargs):
    files = collect_data_files(modname, **kwargs)
    if flatten_dirs:
        # files = [(source, os.path.split(dest)[0])for source, dest in files]
        files = [(source, "") for source, dest in files]

    return files


if __name__ == '__main__':

    print(_module_path("pyopencl"))
    print(_module_path("gputools"))
    print(_module_path("PyQt5"))


    # print _get_toc_objects(os.path.join(_module_path("pyopencl"), "cl"),
    #                    dir_prefix = "pyopencl/cl")

    print(collect_dynamic_libs("PyQt5"))
    print(collect_dynamic_libs("pyopencl"))

    # print _my_collect_data_files("pyopencl", include_py_files = True)
    # print _my_collect_data_files("gputools")
    print(_my_collect_data_files("gputools", flatten_dirs = True))


Example #28
0
#-----------------------------------------------------------------------------
# Copyright (c) 2016-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
"""
accessible_output2: http://hg.q-continuum.net/accessible_output2
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('accessible_output2')
Example #29
0
# -----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
# -----------------------------------------------------------------------------
#
# A fast, distributed, high performance gradient boosting
# (GBT, GBDT, GBRT, GBM or MART) framework based on decision
# tree algorithms, used for ranking, classification and
# many other machine learning tasks.
#
# https://github.com/microsoft/LightGBM
#
# Tested with:
# Tested on Windows 10 & macOS 10.14 with Python 3.7.5

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('lightgbm')
binaries += collect_dynamic_libs('sklearn')
binaries += collect_dynamic_libs('scipy')
Example #30
0
# ------------------------------------------------------------------
# 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.GPL.txt, 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')
Example #31
0
#-----------------------------------------------------------------------------
# Copyright (c) 2018-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

# hook for https://github.com/r0x0r/pywebview

from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
from PyInstaller.compat import is_win

if is_win:
    datas = collect_data_files('webview', subdir='lib')
    binaries = collect_dynamic_libs('webview')
Example #32
0
# -----------------------------------------------------------------------------
# Copyright (c) 2016-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
# -----------------------------------------------------------------------------
"""
Libaudioverse: https://github.com/libaudioverse/libaudioverse
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('libaudioverse')
Example #33
0
#-----------------------------------------------------------------------------
# Copyright (c) 2018-2018, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
"""
Hook for https://github.com/libtcod/python-tcod
"""
from PyInstaller.utils.hooks import collect_dynamic_libs

hiddenimports = ['_cffi_backend']

# Install shared libraries to the working directory.
binaries = collect_dynamic_libs('tcod', destdir='.')
Example #34
0
# 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.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------

from PyInstaller.compat import is_win, is_darwin
from PyInstaller.utils.hooks import collect_dynamic_libs, logger

# Collect bundled mediainfo shared library (available in Windows and macOS wheels on PyPI).
binaries = collect_dynamic_libs("pymediainfo")

# On linux, no wheels are available, and pymediainfo uses system shared library.
if not binaries and not (is_win or is_darwin):

    def _find_system_mediainfo_library():
        import os
        import ctypes.util
        from PyInstaller.depend.utils import _resolveCtypesImports

        libname = ctypes.util.find_library("mediainfo")
        if libname is not None:
            resolved_binary = _resolveCtypesImports(
                [os.path.basename(libname)])
            if resolved_binary:
                return resolved_binary[0][1]
Example #35
0
import os
import sys

from PyInstaller.compat import is_darwin
from PyInstaller.utils.hooks import exec_statement, collect_data_files, \
    collect_dynamic_libs, eval_script


# TODO Add Linux support
# Collect first all files that were installed directly into pyenchant
# package directory and this includes:
# - Windows: libenchat-1.dll, libenchat_ispell.dll, libenchant_myspell.dll, other
#            dependent dlls and dictionaries for several languages (de, en, fr)
# - Mac OS X: usually libenchant.dylib and several dictionaries when installed via pip.
binaries = collect_dynamic_libs('enchant')
datas = collect_data_files('enchant')


# On OS X try to find files from Homebrew or Macports environments.
if is_darwin:
    # 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 hook with development version of enchant.
    libenchant = exec_statement("""
from enchant._enchant import e
print(e._name)
""").strip()

    # Check libenchant was not installed via pip but is somewhere on disk.
from PyInstaller.utils.hooks import collect_submodules, collect_dynamic_libs
hiddenimports = collect_submodules('pandas')
binaries = collect_dynamic_libs('pandas')
Example #37
0
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2018, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------


# Hook for the diStorm3 module: https://pypi.python.org/pypi/distorm3
# Tested with distorm3 3.3.0, Python 2.7, Windows

from PyInstaller.utils.hooks import collect_dynamic_libs

# distorm3 dynamic library should be in the path with other dynamic libraries.
binaries = collect_dynamic_libs('distorm3', destdir='.')
Example #38
0
from PyInstaller.utils.hooks import collect_submodules, collect_dynamic_libs
hiddenimports = collect_submodules('sklearn')
binaries = collect_dynamic_libs('sklearn')
Example #39
0
#-----------------------------------------------------------------------------
# Copyright (c) 2016-2018, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
"""
python-wavefile: https://github.com/vokimon/python-wavefile
"""

from PyInstaller.utils.hooks import collect_dynamic_libs

binaries = collect_dynamic_libs('wavefile')
Example #40
0
#-----------------------------------------------------------------------------
# Based on examples at https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/hooks/
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_dynamic_libs, collect_data_files, exec_statement, copy_metadata,\
    collect_submodules, get_package_paths
import os.path

(_, obspy_root) = get_package_paths('obspy')

binaries = collect_dynamic_libs('obspy')
datas = [
    # Dummy path, this needs to exist for obspy.core.util.libnames._load_cdll
    (os.path.join(obspy_root, "*.txt"), os.path.join('obspy', 'core', 'util')),
    # Data
    (os.path.join(obspy_root, "imaging", "data"), os.path.join('obspy', 'imaging', 'data')),
    (os.path.join(obspy_root, "taup", "data"), os.path.join('obspy', 'taup', 'data')),
    (os.path.join(obspy_root, "geodetics", "data"), os.path.join('obspy', 'geodetics', 'data')),
]

# Plugins are defined in the metadata (.egg-info) directory, but if we grab the whole thing it causes
# other errors, so include only entry_points.txt
metadata = copy_metadata('obspy')
egg = metadata[0]
if '.egg' not in egg[0]:
    raise Exception("Unexpected metadata: %s" % (metadata,))
# Specify the source as just the entry points file
metadata = [(os.path.join(egg[0], 'entry_points.txt'), egg[1])]
datas += metadata

# Thse are the actual plugin packages