Beispiel #1
0
 def setUp(self, package=HOOKUTILS_TEST_FILES):
     self.basepath = join(os.getcwd(), HOOKUTILS_TEST_FILES)
     # Fun Python behavior: __import__('mod.submod') returns mod,
     # where as __import__('mod.submod', fromlist = [a non-empty list])
     # returns mod.submod. See the docs on `__import__
     # <http://docs.python.org/library/functions.html#__import__>`_.
     self.data_list = collect_data_files(__import__(package, fromlist=['']))
     self.split_data_list()
 def setUp(self, package = HOOKUTILS_TEST_FILES):
     self.parentpath = join(os.getcwd(), HOOKUTILS_TEST_FILES)
     # Fun Python behavior: __import__('mod.submod') returns mod,
     # where as __import__('mod.submod', fromlist = [a non-empty list])
     # returns mod.submod. See the docs on `__import__
     # <http://docs.python.org/library/functions.html#__import__>`_.
     self.data_list = collect_data_files(__import__(package,
                                                   fromlist = ['']))
     self.split_data_list()
Beispiel #3
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils 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')
Beispiel #4
0
 def test_4(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES + '.subpkg')
     self.split_data_list()
     self.assert_data_list_equal(self.subpkg_subfiles)
Beispiel #5
0
 def test_0(self):
     # os is a module, not a package.
     with self.assertRaises(AttributeError):
         collect_data_files(__import__('os'))
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files('ionize')
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('jsonschema')
Beispiel #8
0
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function#, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)

# Remove cython and coverage byproducts
def ext_filter(source):
    base = os.path.basename(source)
    if base == '.coverage':
        return False
    name, ext = os.path.splitext(base)
    return ext not in ('.c', '.html')

mceditlib_datas = collect_data_files('mceditlib')
mceditlib_datas = [(source, dest)
                   for source, dest in mceditlib_datas
                   if ext_filter(source)]

mcedit2_datas = collect_data_files('mcedit2')
mcedit2_datas = [(source, dest)
                 for source, dest in mcedit2_datas
                 if ext_filter(source)]

datas = mceditlib_datas + mcedit2_datas

Beispiel #9
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils 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')
Beispiel #10
0
    logger.info('Django root directory %s', root_dir)
    hiddenimports = django_dottedstring_imports(root_dir)
    # Include main django modules - settings.py, urls.py, wsgi.py.
    # Without them the django server won't run.
    package_name = os.path.basename(root_dir)
    hiddenimports += [
        # TODO Consider including 'mysite.settings.py' in source code as a data files.
        #      Since users might need to edit this file.
        package_name + '.settings',
        package_name + '.urls',
        package_name + '.wsgi',
    ]
    # Include some hidden modules that are not imported directly in django.
    hiddenimports += [
        'django.template.defaultfilters',
        'django.template.defaulttags',
        'django.template.loader_tags',
    ]
    # Other hidden imports to get Django example startproject working.
    hiddenimports += [
        'django.contrib.messages.storage.fallback',
    ]
    # Include django data files - localizations, etc.
    datas = collect_data_files('django')

    # Include data files from your Django project found in your django root package.
    datas += collect_data_files(package_name)

else:
    logger.warn('No django root directory could be found!')
# -*- coding: utf-8 -*-

from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('mongrey', subdir='translations')
datas += collect_data_files('mongrey', subdir='web/static')
datas += collect_data_files('mongrey', subdir='web/templates')
datas += collect_data_files('mongrey', subdir='ext')
Beispiel #12
0
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files(
    "S:\\Development\\Python\\jarvis_voiceai\\venv\\Lib\\site-packages\\speech_recognition"
)
Beispiel #13
0
# -----------------------------------------------------------------------------
# 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.
# -----------------------------------------------------------------------------
from PyInstaller.hooks.hookutils import collect_data_files  # pragma: no cover

datas = collect_data_files('certifi')  # pragma: no cover
Beispiel #14
0
#        pkg_base, pkg_dir = get_package_paths(package)
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 646, in get_package_paths
#        assert is_package, 'Package %s does not have __path__ attribute' % package
#    AssertionError: Package PyKDE4 does not have __path__ attribute
#
# Therefeore, catch this exception and ignore it. When this happends, a message
# is still generated::
#
#    2141 INFO: Processing hook hook-PyQt4.QtCore
#    Traceback (most recent call last):
#      File "<string>", line 1, in <module>
#    ImportError: No module named PyKDE4
#    2862 INFO: Processing hook hook-PyQt4.uic
#
# Note that the warning comes BEFORE hook-PyQt4.uic is listed, not after;
# however, the raised assertion caught by the try/except block below produces
# it, not any code in hook-PyQt4.QtCore.
if is_linux:
    try:
        hiddenimports = collect_submodules('PyKDE4') + [
            'PyQt4.QtSvg', 'PyQt4.QtXml'
        ]
    except AssertionError:
        pass
# Need to include modules in PyQt4.uic.widget-plugins, so they can be
# dynamically loaded by uic. They should both be included as separate
# (data-like) files, so they can be found by os.listdir and friends. However,
# this directory isn't a package, refer to it using the package (PyQt4.uic)
# followed by the subdirectory name (widget-plugins/).
datas = collect_data_files('PyQt4.uic', True, 'widget-plugins')
Beispiel #15
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import (collect_data_files, collect_submodules)


# IPython (tested with 0.13) requires the following files:
#   ./site-packages/IPython/config/profile/README_STARTUP
datas = collect_data_files('IPython')
hiddenimports = collect_submodules('IPython')
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('certifi')
 def test_0(self):
     # os is a module, not a package.
     with self.assertRaises(AttributeError):
         collect_data_files(__import__('os'))
Beispiel #18
0
# -----------------------------------------------------------------------------
# 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.hooks.hookutils 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")
 def test_3(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES)
     self.split_data_list()
     self.assert_data_list_equal(self.all_subfiles)
Beispiel #20
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_data_files

datas = collect_data_files('selenium')
 def test_4(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES +
                                         '.subpkg')
     self.split_data_list()
     self.assert_data_list_equal(self.subpkg_subfiles)
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('cloudify_cli')
Beispiel #23
0
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

# Module PyPI Homepage: https://pypi.python.org/pypi/names/0.3.0


from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('names')
Beispiel #24
0
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.hooks.hookutils import collect_data_files
from PyInstaller.hooks.hookutils 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')
Beispiel #25
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_data_files

hiddenimports = ["babel.dates"]
datas = collect_data_files('babel')
Beispiel #26
0
 def test_3(self):
     self.data_list = collect_data_files(HOOKUTILS_TEST_FILES)
     self.split_data_list()
     self.assert_data_list_equal(self.all_subfiles)
Beispiel #27
0
# -----------------------------------------------------------------------------
# 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 cacert.pem that comes with requests module
from PyInstaller.hooks.hookutils import collect_data_files  # pragma: no cover

datas = collect_data_files('requests')  # pragma: no cover
Beispiel #28
0
from PyInstaller.hooks.hookutils import collect_data_files
datas = collect_data_files('mpl_toolkits.basemap')
Beispiel #29
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_data_files

datas = collect_data_files('idlelib')
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_data_files

datas = collect_data_files('countrycode')
Beispiel #31
0
#-----------------------------------------------------------------------------
# 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.
#-----------------------------------------------------------------------------

import os.path
from PyInstaller.hooks.hookutils import (collect_data_files,
                                         collect_submodules)
from distutils.sysconfig import get_python_inc

# IPython (tested with 0.13) requires the following files:
#   ./site-packages/IPython/config/profile/README_STARTUP
datas = collect_data_files('scipy.weave')
datas += collect_data_files('numpy.core')
datas += [(get_python_inc(), 'include')]

hiddenimports = collect_submodules('scipy.weave')
from PyInstaller.hooks.hookutils import get_package_paths
from PyInstaller.hooks.hookutils import collect_data_files

package_name = "cloudify_openstack"
package_path = get_package_paths(package_name)[1]

datas = [(package_path + "/*.py", package_name)] + collect_data_files(package_name)
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files("requests")
Beispiel #34
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils 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')
Beispiel #35
0
"""
    hook-mcedit2.py
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function  #, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)

datas = collect_data_files('mceditlib') + collect_data_files('mcedit2')
Beispiel #36
0
# shouldn't hurt.


from PyInstaller.compat import is_win, is_darwin
from PyInstaller.hooks.hookutils import collect_data_files
from PyInstaller.hooks.hookutils 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')
# -*- coding: utf-8 -*-

from PyInstaller.hooks.hookutils import collect_submodules, collect_data_files

hiddenimports = collect_submodules('flask.ext')
hiddenimports += collect_submodules('flask_security')

datas = collect_data_files('flask_security', subdir='templates')

Beispiel #38
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_data_files
datas = collect_data_files('idlelib')
Beispiel #39
0
    logger.info('Django root directory %s', root_dir)
    hiddenimports = django_dottedstring_imports(root_dir)
    # Include main django modules - settings.py, urls.py, wsgi.py.
    # Without them the django server won't run.
    package_name = os.path.basename(root_dir)
    hiddenimports += [
            # TODO Consider including 'mysite.settings.py' in source code as a data files.
            #      Since users might need to edit this file.
            package_name + '.settings',
            package_name + '.urls',
            package_name + '.wsgi',
    ]
    # Include some hidden modules that are not imported directly in django.
    hiddenimports += [
            'django.template.defaultfilters',
            'django.template.defaulttags',
            'django.template.loader_tags',
    ]
    # Other hidden imports to get Django example startproject working.
    hiddenimports += [
            'django.contrib.messages.storage.fallback',
    ]
    # Include django data files - localizations, etc.
    datas = collect_data_files('django')

    # Include data files from your Django project found in your django root package.
    datas += collect_data_files(package_name)

else:
    logger.warn('No django root directory could be found!')
Beispiel #40
0
#-----------------------------------------------------------------------------
# Copyright (c) 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 weasyprint: https://pypi.python.org/pypi/WeasyPrint
# Tested on version weasyprint 0.24 using Windows 7 and python 2.7

from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('weasyprint')
Beispiel #41
0
    hook-mcedit2.py
    Hook for pyinstaller to collect MCEdit's data files
"""
from __future__ import absolute_import, division, print_function  #, unicode_literals
import glob
import logging
import os
from PyInstaller.hooks.hookutils import collect_data_files

log = logging.getLogger(__name__)


# Remove cython and coverage byproducts
def ext_filter(source):
    base = os.path.basename(source)
    if base == '.coverage':
        return False
    name, ext = os.path.splitext(base)
    return ext not in ('.c', '.html')


mceditlib_datas = collect_data_files('mceditlib')
mceditlib_datas = [(source, dest) for source, dest in mceditlib_datas
                   if ext_filter(source)]

mcedit2_datas = collect_data_files('mcedit2')
mcedit2_datas = [(source, dest) for source, dest in mcedit2_datas
                 if ext_filter(source)]

datas = mceditlib_datas + mcedit2_datas
#        hiddenimports += collect_submodules('PyKDE4') + ['PyQt4.QtSvg', 'PyQt4.QtXml']
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 679, in collect_submodules
#        pkg_base, pkg_dir = get_package_paths(package)
#      File "/usr/local/lib/python2.7/dist-packages/PyInstaller-2.1.1dev_9e9d21b-py2.7.egg/PyInstaller/hooks/hookutils.py", line 646, in get_package_paths
#        assert is_package, 'Package %s does not have __path__ attribute' % package
#    AssertionError: Package PyKDE4 does not have __path__ attribute
#
# Therefeore, catch this exception and ignore it. When this happends, a message
# is still generated::
#
#    2141 INFO: Processing hook hook-PyQt4.QtCore
#    Traceback (most recent call last):
#      File "<string>", line 1, in <module>
#    ImportError: No module named PyKDE4
#    2862 INFO: Processing hook hook-PyQt4.uic
#
# Note that the warning comes BEFORE hook-PyQt4.uic is listed, not after;
# however, the raised assertion caught by the try/except block below produces
# it, not any code in hook-PyQt4.QtCore.
if is_linux:
    try:
        hiddenimports = collect_submodules('PyKDE4') + ['PyQt4.QtSvg', 'PyQt4.QtXml']
    except AssertionError:
        pass
# Need to include modules in PyQt4.uic.widget-plugins, so they can be
# dynamically loaded by uic. They should both be included as separate
# (data-like) files, so they can be found by os.listdir and friends. However,
# this directory isn't a package, refer to it using the package (PyQt4.uic)
# followed by the subdirectory name (widget-plugins/).
datas = collect_data_files('PyQt4.uic', True, 'widget-plugins')
from PyInstaller.hooks.hookutils import collect_data_files

# Get the cacert.pem
datas = collect_data_files('appscript') 
Beispiel #44
0
#-----------------------------------------------------------------------------
# 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.hooks.hookutils import collect_submodules, collect_data_files

hiddenimports = collect_submodules('sphinx.ext')
datas = collect_data_files('sphinx')
Beispiel #45
0
from PyInstaller.hooks.hookutils import collect_data_files, collect_submodules
datas = collect_data_files('natcap.rios') + collect_data_files(
    'natcap.rios.rui')
hiddenimports = collect_submodules('natcap.rios') + collect_submodules(
    'natcap.rios.rui') + collect_submodules('multiprocessing')
from PyInstaller.hooks.hookutils import collect_data_files

datas = collect_data_files('requests')
Beispiel #47
0
from PyInstaller.hooks.hookutils import get_package_paths
from PyInstaller.hooks.hookutils import collect_data_files

package_name = 'cloudify_openstack'
package_path = get_package_paths(package_name)[1]

datas = [(package_path + '/*.py', package_name)
         ] + collect_data_files(package_name)