Example #1
0
#-----------------------------------------------------------------------------
# Copyright (c) 2015-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------


from PyInstaller.utils.hooks import collect_data_files, copy_metadata


datas = collect_data_files('pint')
datas += copy_metadata('pint')
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("eth_account")
Example #3
0
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('google-cloud-dns')
datas += copy_metadata('google-cloud-core')
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("eth_utils")
Example #5
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013-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/pipermerriam/flex

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('flex')
Example #6
0
from PyInstaller.utils.hooks import copy_metadata, collect_submodules

datas = copy_metadata('traitsui')

hiddenimports = collect_submodules('traitsui.qt4')
# issue with loading
init_py_path = os.path.abspath(os.path.join(curr_path, '..', '..', '__init__.py'))

datas.append((init_py_path, temp_pkg))

datas += rename('webrecorder' + os.path.sep,
                temp_pkg + os.path.sep,
                collect_data_files('webrecorder', subdir='templates'))

datas += collect_data_files('webrecorder', subdir='static')
datas += collect_data_files('webrecorder', subdir='config')

# generate full version
full_version_path = os.path.abspath(os.path.join(curr_path, '..', '..', 'config', '_full_version'))
with open(full_version_path, 'wt') as fh:
    fh.write(get_version_str())
    fh.flush()

datas.append((full_version_path, 'webrecorder/config'))



datas += copy_metadata('bottle')

hiddenimports = ['webrecorder.git_hash',
                 'pywb.git_hash',
                 'brotli',
                 'configparser',
                 '_cffi_backend']

Example #8
0
#-----------------------------------------------------------------------------
# Copyright (c) 2015-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.
#-----------------------------------------------------------------------------

# Hook for the pyopencl module: https://github.com/pyopencl/pyopencl

from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata('pyopencl')
datas += collect_data_files('pyopencl')
Example #9
0
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2017 Tobias Gruetzmacher

from __future__ import absolute_import, division, print_function
from PyInstaller.utils.hooks import collect_submodules, copy_metadata

hiddenimports = collect_submodules('dosagelib.plugins')
datas = copy_metadata('dosage')
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("pymediainfo")
#-----------------------------------------------------------------------------
# Copyright (c) 2017-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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-translate')
Example #12
0
#-----------------------------------------------------------------------------


"""
Hook for cryptography module from the Python Cryptography Authority.
"""

import os.path
import glob

from PyInstaller.compat import EXTENSION_SUFFIXES
from PyInstaller.utils.hooks import collect_submodules, get_module_file_attribute
from PyInstaller.utils.hooks import copy_metadata

# 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.
binaries = []
cryptography_dir = os.path.dirname(get_module_file_attribute('cryptography'))
for ext in EXTENSION_SUFFIXES:
#-----------------------------------------------------------------------------
# Copyright (c) 2017-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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-core')
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("eth_keyfile")
Example #15
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 copy_metadata
from PyInstaller.utils.hooks import collect_data_files

# googleapiclient.model queries the library version via
# pkg_resources.get_distribution("google-api-python-client").version,
# so we need to collect that package's metadata
datas = copy_metadata('google_api_python_client')
datas += collect_data_files('googleapiclient.discovery', excludes=['*.txt', '**/__pycache__'])
Example #16
0
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('docopt')
Example #17
0
from PyInstaller.utils.hooks import collect_data_files, copy_metadata
datas = collect_data_files('pip')
datas += copy_metadata('pip')
datas += copy_metadata('setuptools')
Example #18
0
from PyInstaller.utils.hooks import collect_data_files, collect_entry_point, collect_submodules, copy_metadata

# Imports needed to run tests
datas, hiddenimports = collect_entry_point("pytest11")
hiddenimports += collect_submodules('numpy.distutils')
hiddenimports += collect_submodules('setuptools')
hiddenimports += ['sunpy.data.data_manager.tests.mocks']
hiddenimports += collect_submodules('sunpy')
datas += collect_data_files("sunpy")
datas += collect_data_files("drms")
datas += copy_metadata("sunpy")
Example #19
0
#-----------------------------------------------------------------------------
# Copyright (c) 2015-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 the pyopencl module: https://github.com/pyopencl/pyopencl

from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata('pyopencl')
datas += collect_data_files('pyopencl')
Example #20
0
# SPDX-License-Identifier: MIT
# Copyright (C) 2016-2020 Tobias Gruetzmacher
from PyInstaller.utils.hooks import collect_submodules, copy_metadata

hiddenimports = collect_submodules('dosagelib.plugins')
datas = copy_metadata('dosage')
#-----------------------------------------------------------------------------
# Copyright (c) 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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-storage')
def rename(old, new, t):
    return [(n, v.replace(old, new)) for n, v in t]


# Build webassets bundle
curr_path = os.path.dirname(__file__)
assets_path = os.path.abspath(
    os.path.join(curr_path, '..', '..', 'config', 'assets.yaml'))
build(assets_path)

datas = []

# special package to put templates into to allow pyinstaller pkg_resources to find them
temp_pkg = 'wrtemp'

# move templates to separate 'wrtemp' package (only for bundled apps) to avoid
# issue with loading
init_py_path = os.path.abspath(
    os.path.join(curr_path, '..', '..', '__init__.py'))

datas.append((init_py_path, temp_pkg))

datas += rename('webrecorder' + os.path.sep, temp_pkg + os.path.sep,
                collect_data_files('webrecorder', subdir='templates'))

datas += collect_data_files('webrecorder', subdir='static')
datas += collect_data_files('webrecorder', subdir='config')

datas += copy_metadata('bottle')
Example #23
0
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from PyInstaller.utils.hooks import copy_metadata

distutils = collect_submodules('distutils')

hiddenimports = distutils

datas = collect_data_files('traits') + copy_metadata('traits')
Example #24
0
from PyInstaller.utils.hooks import collect_data_files, copy_metadata

datas = copy_metadata('pyhive')
hiddenimports = ['pyhive.sqlalchemy_presto']

Example #25
0
# -*- coding: utf-8 -*-
# 本文件是 pyinstaller 打包用的,打包命令:
# pyinstaller -F main.py --additional-hooks-dir=.
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('apscheduler')
Example #26
0
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('betty')
#-----------------------------------------------------------------------------
# Copyright (c) 2019-2021, 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)
#-----------------------------------------------------------------------------
"""
importlib_metadata is a library to access the metadata for a Python package.
This functionality intends to replace most uses of pkg_resources entry point
API and metadata API.
"""

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('importlib_metadata')
#-----------------------------------------------------------------------------
# Copyright (c) 2015-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import collect_all, copy_metadata

excludedimports = ["gevent.testing", "gevent.tests"]

datas, binaries, hiddenimports = collect_all(
    'gevent',
    filter_submodules=lambda name: ("gevent.testing" not in name or "gevent.tests" not in name),
    include_py_files=False,
    exclude_datas=["**/tests"]
)

# Gevent uses ``pkg_resources.require("...")``, which means that all its dependencies must also have their metadata.
datas += copy_metadata('gevent', recursive=True)
Example #29
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013-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/python-lz4/python-lz4

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('lz4')
Example #30
0
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, \
    copy_metadata

datas = copy_metadata('chaostoolkit-spring', recursive=True)
hiddenimports = (collect_submodules('chaospring'))
Example #31
0
from PyInstaller.utils.hooks import copy_metadata, collect_data_files
datas = copy_metadata("countryinfo") + collect_data_files("countryinfo")
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-api-python-client')
Example #33
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-logilab.py - PyInstaller hook file for logilab
# ***************************************************
# The following was written about logilab, version 1.1.0, based on executing
# ``pip show logilab-common``.
#
# In logilab.common, line 33::
#
#    __version__ = pkg_resources.get_distribution('logilab-common').version
#
# Therefore, we need metadata for logilab.
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('logilab-common')
Example #34
0
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("google-api-core")
Example #35
0
# ***************************************************
# hook-regex.py - PyInstaller hook file for ``regex``
# ***************************************************
# Enki uses ``pkg_resources`` to obtain the ``regex`` version. So, we need to
# copy over the ``regex`` metadata.
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('regex')
Example #36
0
from PyInstaller.utils.hooks import copy_metadata, get_package_paths

datas = copy_metadata('fastprogress')
Example #37
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
# ------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('workflow')
Example #38
0
#-----------------------------------------------------------------------------
# Copyright (c) 2017-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('google-cloud-speech')
Example #39
0
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('torchvision')
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
from PyInstaller.utils.hooks import copy_metadata, collect_all

datas, binaries, hiddenimports = collect_all('fosslight_dependency')
datas += copy_metadata('fosslight_dependency')
import os
import sys

from PyInstaller.utils.hooks import (
    collect_data_files, collect_dynamic_libs, copy_metadata)

hiddenimports = ['cython', 'Cython', 'resampy', 'mock']

datas = collect_data_files('resampy')

datas += copy_metadata('mock')

if sys.platform == 'darwin':
    binaries = [(os.path.expanduser('~/dev/tools/bin/reaper'), '.')]


from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('umap-learn')
Example #43
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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("web3")
Example #44
0
from PyInstaller.utils.hooks import (  # pylint:disable=import-error
    copy_metadata, )

# needed for `dvc doctor` to show dep versions
datas = copy_metadata("adlfs", recursive=True)
datas += copy_metadata("knack")
datas += copy_metadata("gcsfs")
datas += copy_metadata("pyarrow")
datas += copy_metadata("hdfs")
datas += copy_metadata("pydrive2")
datas += copy_metadata("s3fs", recursive=True)
datas += copy_metadata("boto3")
datas += copy_metadata("ossfs")
datas += copy_metadata("sshfs")
datas += copy_metadata("webdav4")
datas += copy_metadata("aiohttp")
datas += copy_metadata("aiohttp_retry")

# https://github.com/pypa/setuptools/issues/1963
hiddenimports = ["pkg_resources.py2_warn"]
Example #45
0
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from PyInstaller.utils.hooks import copy_metadata

qt = collect_submodules('pyface.qt')
ui_qt = collect_submodules('pyface.ui.qt4')

hiddenimports = qt + ui_qt

datas = collect_data_files('pyface') + copy_metadata('pyface')
Example #46
0
from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('pyface') + copy_metadata('traitsui')

Example #47
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.
#-----------------------------------------------------------------------------

# Hook for the zeep module: https://pypi.python.org/pypi/zeep
# Tested with zeep 0.13.0, Python 2.7, Windows

from PyInstaller.utils.hooks import copy_metadata
datas = copy_metadata('zeep')
Example #48
0
#-----------------------------------------------------------------------------
# Copyright (c) 2014-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-logilab.py - PyInstaller hook file for logilab
# ***************************************************
# The following was written about logilab, version 1.1.0, based on executing
# ``pip show logilab-common``.
#
# In logilab.common, line 33::
#
#    __version__ = pkg_resources.get_distribution('logilab-common').version
#
# Therefore, we need metadata for logilab.
from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('logilab-common')
Example #49
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.
#-----------------------------------------------------------------------------

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata("eth_abi")
Example #50
0
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.

from PyInstaller.utils.hooks import copy_metadata

# in order for viv-utils to use pkg_resources to fetch
# the installed version of vivisect,
# we need to instruct pyinstaller to embed this metadata.
#
# so we set the pyinstaller.spec/hookspath to reference
#  the directory with this hook.
#
# this hook runs at analysis time and updates the embedded metadata.
#
# ref: https://github.com/pyinstaller/pyinstaller/issues/1713#issuecomment-162682084
datas = copy_metadata("vivisect")

excludedimports = [
    # viv gui requires these heavy libraries,
    # but viv as a library doesn't.
    # they shouldn't be installed in our configuration,
    # but we'll ensure they don't slip in here (such as on developers' systems).
    "PyQt5",
    "qt5",
    "pyqtwebengine",
    # the above are imported by these viv modules.
    # so really, we'd want to exclude these submodules of viv.
    # but i dont think this works.
    "vqt",
    "vdb.qt",
    "envi.qt",
    # unused by capa
Example #51
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013-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://pypi.python.org/pypi/jira/
"""

from PyInstaller.utils.hooks import copy_metadata, collect_submodules

datas = copy_metadata('jira')
hiddenimports = collect_submodules('jira')
Example #52
0
#-----------------------------------------------------------------------------

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
hiddenimports = collect_submodules('obspy.io')