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
def data_lists(monkeypatch, request): def _sort(sequence): l = list(sequence) l.sort() return tuple(l) # Add path with 'hookutils_files' module to ``sys.path`` so tests # could find this module - useful for subprocesses. monkeypatch.syspath_prepend(TEST_MOD_PATH) # Use the hookutils_test_files package for testing. mod_name = request.param[0] data = collect_data_files(mod_name) # Break list of (source, dest) into source and dest lists. subfiles = request.param[1] src = [item[0] for item in data] dst = [item[1] for item in data] return subfiles, _sort(src), _sort(dst)
def data_lists(monkeypatch, request): def _sort(sequence): l = list(sequence) l.sort() return tuple(l) # Add path with 'hookutils_files' module to PYTHONPATH so tests # could find this module - useful for subprocesses. pth = os.path.dirname(os.path.abspath(__file__)) monkeypatch.setenv('PYTHONPATH', pth) # Use the hookutils_test_files package for testing. mod_name = request.param[0] data = collect_data_files(mod_name) # Break list of (source, dest) into source and dest lists. subfiles = request.param[1] src = [item[0] for item in data] dst = [item[1] for item in data] return subfiles, _sort(src), _sort(dst)
# -*- mode: python -*- #----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- # Hook for the uniseg module: https://pypi.python.org/pypi/uniseg from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('hy', include_py_files=True)
#----------------------------------------------------------------------------- # Copyright (c) 2005-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://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')
#----------------------------------------------------------------------------- # Copyright (c) 2005-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. #----------------------------------------------------------------------------- # This is needed to bundle lib2to3 Grammars files from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('lib2to3')
#----------------------------------------------------------------------------- # 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 speech_recognition: https://pypi.python.org/pypi/SpeechRecognition/ # Tested on Windows 8.1 x64 with SpeechRecognition 1.5 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files("speech_recognition")
] # Include migration scripts of Django-based apps too. installed_apps = eval(get_module_attribute(package_name + '.settings', 'INSTALLED_APPS')) migration_modules.extend(set(app + '.migrations' for app in installed_apps)) # Copy migration files. for mod in migration_modules: mod_name, bundle_name = mod.split('.', 1) mod_dir = os.path.dirname(get_module_file_attribute(mod_name)) bundle_dir = bundle_name.replace('.', os.sep) pattern = os.path.join(mod_dir, bundle_dir, '*.py') files = glob.glob(pattern) for f in files: datas.append((f, os.path.join(mod_name, bundle_dir))) # Include data files from your Django project found in your django root package. datas += collect_data_files(package_name) # Include database file if using sqlite. The sqlite database is usually next to the manage.py script. root_dir_parent = os.path.dirname(root_dir) # TODO Add more patterns if necessary. _patterns = ['*.db', 'db.*'] for p in _patterns: files = glob.glob(os.path.join(root_dir_parent, p)) for f in files: # Place those files next to the executable. datas.append((f, '.')) else: logger.warning('No django root directory could be found!')
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_submodules, collect_data_files hiddenimports = (collect_submodules('docutils.languages') + collect_submodules('docutils.writers') + collect_submodules('docutils.parsers.rst.languages') + collect_submodules('docutils.parsers.rst.directives')) datas = collect_data_files('docutils')
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('selenium')
# ------------------------------------------------------------------ # 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 collect_submodules, collect_data_files hiddenimports = collect_submodules('tensorflow_core') datas = collect_data_files('tensorflow_core')
from PyInstaller.utils.hooks import collect_submodules from PyInstaller.utils.hooks import collect_data_files hiddenimports = collect_submodules('palettable') datas = collect_data_files('palettable')
# ------------------------------------------------------------------ # 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 collect_data_files datas = collect_data_files('pyexcelerate')
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('fleep')
#----------------------------------------------------------------------------- # Copyright (c) 2015-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 collect_data_files datas = collect_data_files('pint')
#----------------------------------------------------------------------------- # 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 collect_data_files datas = collect_data_files('pyproj')
import os from PyInstaller.utils.hooks import (get_module_attribute, is_module_satisfies, qt_menu_nib_dir, get_module_file_attribute, collect_data_files) from PyInstaller.compat import getsitepackages, is_darwin, is_win # On Windows system PATH has to be extended to point to the PySide2 directory. # The PySide directory contains Qt dlls. We need to avoid including different # version of Qt libraries when there is installed another application (e.g. QtCreator) if is_win: from PyInstaller.utils.win32.winutils import extend_system_path extend_system_path([os.path.join(x, 'PySide2') for x in getsitepackages()]) extend_system_path([ os.path.join(os.path.dirname(get_module_file_attribute('PySide2')), 'Qt', 'bin') ]) # FIXME: this should not be needed hiddenimports = ['numpy.core.multiarray'] # TODO: check if this is needed # Collect just the qt.conf file. datas = [ x for x in collect_data_files('PySide2', False, os.path.join('Qt', 'bin')) if x[0].endswith('qt.conf') ]
# Django hiddenimports from the standard Python library. if sys.version_info.major == 3: # Python 3.x hiddenimports += [ 'http.cookies', 'html.parser', ] else: # Python 2.x hiddenimports += [ 'Cookie', 'HTMLParser', ] # Include django data files - localizations, etc. datas = collect_data_files('django') # Bundle django DB schema migration scripts as data files. # They are necessary for some commands. logger.info('Collecting Django migration scripts.') migration_modules = [ 'django.conf.app_template.migrations', 'django.contrib.admin.migrations', 'django.contrib.auth.migrations', 'django.contrib.contenttypes.migrations', 'django.contrib.flatpages.migrations', 'django.contrib.redirects.migrations', 'django.contrib.sessions.migrations', 'django.contrib.sites.migrations', ] # Include migration scripts of Django-based apps too.
from PyInstaller.utils.hooks import collect_submodules, collect_data_files hiddenimports = collect_submodules('faker') datas = collect_data_files('faker.providers', include_py_files=True) #command to create binary distribution #pyinstaller --clean --distpath dist --name console --additional-hooks-dir pyinstaller/ --onefile console.py
#----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- # Hook for nanite: https://pypi.python.org/pypi/nanite from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('nanite')
#----------------------------------------------------------------------------- # Copyright (c) 2013-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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('idlelib')
""" from PyInstaller.utils.hooks import collect_submodules hiddenimports = ['zmq.utils.garbage'] # PyZMQ comes with two backends, cython and cffi. Calling collect_submodules() # on zmq.backend seems to trigger attempt at compilation of C extension # module for cffi backend, which will fail if ZeroMQ development files # are not installed on the system. On non-English locales, the resulting # localized error messages may cause UnicodeDecodeError. Collecting each # backend individually, however, does not seem to cause any problems. hiddenimports += ['zmq.backend'] # cython backend hiddenimports += collect_submodules('zmq.backend.cython') # cffi backend: contains extra data that needs to be collected # (e.g., _cdefs.h) # # NOTE: the cffi backend requires compilation of C extension at runtime, # which appears to be broken in frozen program. So avoid collecting # it altogether... if False: from PyInstaller.utils.hooks import collect_data_files hiddenimports += collect_submodules('zmq.backend.cffi') datas = collect_data_files('zmq.backend.cffi', excludes=[ '**/__pycache__', ])
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- # names: generate random names # Module PyPI Homepage: https://pypi.python.org/pypi/names/0.3.0 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('names')
#----------------------------------------------------------------------------- # Copyright (c) 2015-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 weasyprint: https://pypi.python.org/pypi/WeasyPrint # Tested on version weasyprint 0.24 using Windows 7 and python 2.7 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('weasyprint')
#----------------------------------------------------------------------------- # Copyright (c) 2014, 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. #----------------------------------------------------------------------------- # This is needed to bundle draft3.json and draft4.json files that come # with jsonschema module from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('jsonschema')
from PyInstaller.utils.hooks import collect_data_files hiddenimports = ['cffi'] datas = collect_data_files('tcod') # You may get: 'WARNING: lib not found: SDL.dll', you can ignore this.
# Copyright (c) 2015-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. #----------------------------------------------------------------------------- # # 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.compat import is_py2 from PyInstaller.utils.hooks import is_module_satisfies if is_module_satisfies('botocore >= 1.4.36'): if is_py2: hiddenimports = ['HTMLParser'] else: hiddenimports = ['html.parser'] datas = collect_data_files('botocore')
# ------------------------------------------------------------------ # 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 collect_data_files datas = collect_data_files('astor')
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- # This is needed to bundle cacerts.txt that comes with httplib2 module from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('httplib2')
#----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- # This is needed to bundle draft3.json and draft4.json files that come # with jsonschema module from PyInstaller.utils.hooks import collect_data_files, copy_metadata datas = collect_data_files('jsonschema') datas += copy_metadata('jsonschema')
# ------------------------------------------------------------------ # 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 the uniseg module: https://pypi.python.org/pypi/uniseg from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('uniseg')
#----------------------------------------------------------------------------- # Copyright (c) 2015-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 weasyprint: https://pypi.python.org/pypi/WeasyPrint # Tested on version weasyprint 0.24 using Windows 7 and python 2.7 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('weasyprint')
from PyInstaller.utils.hooks import collect_data_files data = collect_data_files("psims")
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_data_files # core/_templates/* # server/static/**/* # subcommands/*.py datas = collect_data_files('bokeh.core') + \ collect_data_files('bokeh.server') + \ collect_data_files('bokeh.command.subcommands', include_py_files=True)
#----------------------------------------------------------------------------- # Copyright (c) 2014-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 # Hook tested with scikit-image (skimage) 0.9.3 on Mac OS 10.9 and Windows 7 # 64-bit hiddenimports = [ 'skimage.draw.draw', 'skimage._shared.geometry', 'skimage._shared.transform', 'skimage.filters.rank.core_cy' ] datas = collect_data_files('skimage')
# 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 # ------------------------------------------------------------------ """ Pyinstaller hook for u1db module This hook was tested with: - u1db 0.1.4 : https://launchpad.net/u1db - Python 2.7.10 - Linux Debian GNU/Linux unstable (sid) Test script used for testing: import u1db db = u1db.open("mydb1.u1db", create=True) doc = db.create_doc({"key": "value"}, doc_id="testdoc") print doc.content print doc.doc_id """ from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('u1db')
from PyInstaller.utils.hooks import collect_data_files hiddenimports = ["pyforms.Controls"] datas = collect_data_files('pyforms')
#----------------------------------------------------------------------------- # Copyright (c) 2005-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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import copy_metadata, collect_data_files datas = copy_metadata('radicale') datas += collect_data_files('radicale')
#----------------------------------------------------------------------------- # Copyright (c) 2013-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 openpyxl module: https://pypi.python.org/pypi/openpyxl # Tested with openpyxl 2.3.4, Python 2.7, Windows from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('openpyxl')
#----------------------------------------------------------------------------- # Copyright (c) 2013-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 datas = collect_data_files('countrycode')
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- # Hook for Shape-Out: https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut from PyInstaller.utils.hooks import collect_data_files # Data files datas = collect_data_files("shapeout") datas += collect_data_files("shapeout", subdir="img") datas += collect_data_files("shapeout", subdir="cfg") datas += collect_data_files("shapeout", subdir="data") ## Hidden imports # nptdms hiddenimports = ["nptdms", "nptdms.version", "nptdms.tdms", "nptdms.tdmsinfo", "pathlib"] # scipy stats hiddenimports += ["scipy.stats", "scipy.special", "scipy.special._ufuncs_cxx"] hiddenimports += ["dclab", "six"]
# ------------------------------------------------------------------ # 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 the xsge_gui module: https://pypi.python.org/pypi/xsge_gui from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('xsge_gui')
from __future__ import absolute_import from PyInstaller.utils.hooks import collect_data_files # Add the data files in the scrapinghub package (aka scrapinghub.VERSION). datas = collect_data_files('scrapinghub')
#----------------------------------------------------------------------------- # Copyright (c) 2013-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. #----------------------------------------------------------------------------- # names: generate random names # Module PyPI Homepage: https://pypi.python.org/pypi/names/0.3.0 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('names')
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- # Tested with IPython 4.0.0. from PyInstaller.compat import modname_tkinter, 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', 'PyQt4', 'PyQt5', 'PySide'] # IPython uses 'tkinter' for clipboard access on Linux/Unix. Exclude it on Windows and OS X. if is_win or is_darwin: excludedimports.append(modname_tkinter) datas = collect_data_files('IPython')
def hook(hook_api): hook_api.add_datas(collect_data_files(hook_api.__name__))
from PyInstaller.utils.hooks import collect_submodules, collect_data_files qt = collect_submodules('enable.qt4') trait_defs_ui_qt = collect_submodules('enable.trait_defs.ui.qt4') savage_trait_defs_ui_qt = collect_submodules('enable.savage.trait_defs.ui.qt4') hiddenimports = qt + trait_defs_ui_qt + savage_trait_defs_ui_qt datas = collect_data_files('enable')
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files("pytzdata", include_py_files=True)
# ----------------------------------------------------------------------------- # Copyright (c) 2013, 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 collect_data_files # On Linux pytz installed from distribution repository uses zoneinfo # fron /usr/share/zoneinfo/ and no data files might be collected. datas = collect_data_files("pytz")
# ----------------------------------------------------------------------------- # Copyright (c) 2013-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) # ----------------------------------------------------------------------------- import os from PyInstaller.utils.hooks import collect_data_files, collect_submodules from jupyter_core.paths import jupyter_config_path, jupyter_path # collect modules for handlers hiddenimports = collect_submodules('notebook', filter=lambda name: name.endswith('.handles')) hiddenimports.append('notebook.services.shutdown') datas = collect_data_files('notebook') # Collect share and etc folder for pre-installed extensions datas += [(path, 'share/jupyter') for path in jupyter_path() if os.path.exists(path)] datas += [(path, 'etc/jupyter') for path in jupyter_config_path() if os.path.exists(path)]
#----------------------------------------------------------------------------- # 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. #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_data_files # pycountry requires the ISO databases for country data. # Tested v1.15 on Linux/Ubuntu. # https://pypi.python.org/pypi/pycountry datas = collect_data_files('pycountry')
# # SPDX-License-Identifier: GPL-2.0-or-later # ------------------------------------------------------------------ """ Hook for use with the ttkwidgets package ttkwidgets provides a set of cross-platform widgets for Tkinter/ttk, some of which depend on image files in order to function properly. These images files are all provided in the `ttkwidgets/assets` folder, which has to be copied by PyInstaller. This hook has been tested on Ubuntu 18.04 (Python 3.6.8 venv) and Windows 7 (Python 3.5.4 system-wide). >>> import tkinter as tk >>> from ttkwidgets import CheckboxTreeview >>> >>> window = tk.Tk() >>> tree = CheckboxTreeview(window) >>> tree.insert("", tk.END, "test", text="Hello World!") >>> tree.insert("test", tk.END, "test2", text="Hello World again!") >>> tree.insert("test", tk.END, "test3", text="Hello World again again!") >>> tree.pack() >>> window.mainloop() """ from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files("ttkwidgets")
from PyInstaller.utils.hooks import collect_submodules, collect_data_files hiddenimports = collect_submodules('pubsub') # collect_submodules does not find `arg1` or `kwargs` because # they are not packages, just folders without an `__init__.py` # Thus they are invisible to ModuleGraph and must be included as data files pubsub_datas = collect_data_files('pubsub', include_py_files=True) def _match(dst): return "kwargs" in dst or "arg1" in dst datas = [(src, dst) for src, dst in pubsub_datas if _match(dst)]
#----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- from PyInstaller.utils.hooks import collect_submodules, collect_data_files hiddenimports = collect_submodules('pysnmp.smi.mibs') datas = collect_data_files('pysnmp.smi.mibs', include_py_files=True)
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. # Probably it was installed from Homebrew or Macports.
# ------------------------------------------------------------------ # 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 collect_data_files datas = collect_data_files("aliyunsdkcore")
""" from PyInstaller.compat import is_win, is_darwin from PyInstaller.utils.hooks import collect_data_files from PyInstaller.utils.hooks import opengl_arrays_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')
# ------------------------------------------------------------------ # 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 speech_recognition: https://pypi.python.org/pypi/SpeechRecognition/ # Tested on Windows 8.1 x64 with SpeechRecognition 1.5 from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files("speech_recognition")
from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files('mitmproxy.tools.web')
#----------------------------------------------------------------------------- # Copyright (c) 2015-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. #----------------------------------------------------------------------------- # # 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')