示例#1
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.utils.hooks import exec_statement, is_module_version

# include most common database bindings
# some database bindings are detected and include some
# are not. We should explicitly include database backends.
hiddenimports = ['pysqlite2', 'MySQLdb', 'psycopg2']

# sqlalchemy.dialects package from 0.6 and newer sqlachemy versions
if is_module_version('sqlalchemy', '>=', '0.6'):
    dialects = exec_statement("import sqlalchemy.dialects;print(sqlalchemy.dialects.__all__)")
    dialects = eval(dialects.strip())

    for n in dialects:
        hiddenimports.append("sqlalchemy.dialects." + n)
else:
    # sqlalchemy.databases package from pre 0.6 sqlachemy versions
    databases = exec_statement("import sqlalchemy.databases; print(sqlalchemy.databases.__all__)")
    databases = eval(databases.strip())

    for n in databases:
        hiddenimports.append("sqlalchemy.databases." + n)
#
# 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 exec_statement, is_module_version

# include most common database bindings
# some database bindings are detected and include some
# are not. We should explicitly include database backends.
hiddenimports = ['pysqlite2', 'MySQLdb', 'psycopg2']

# sqlalchemy.dialects package from 0.6 and newer sqlachemy versions
if is_module_version('sqlalchemy', '>=', '0.6'):
    dialects = exec_statement(
        "import sqlalchemy.dialects;print(sqlalchemy.dialects.__all__)")
    dialects = eval(dialects.strip())

    for n in dialects:
        hiddenimports.append("sqlalchemy.dialects." + n)
else:
    # sqlalchemy.databases package from pre 0.6 sqlachemy versions
    databases = exec_statement(
        "import sqlalchemy.databases; print(sqlalchemy.databases.__all__)")
    databases = eval(databases.strip())

    for n in databases:
        hiddenimports.append("sqlalchemy.databases." + n)
示例#3
0
    # From sphinx.websupport line 100::
    #
    #    mod = 'sphinx.websupport.search.' + mod
    #    SearchClass = getattr(__import__(mod, None, None, [cls]), cls)
    #
    # So, include modules under ``sphinx.websupport.search``.
    collect_submodules('sphinx.websupport.search') +
    #
    # From sphinx.util.inspect line 21::
    #
    #    inspect = __import__('inspect')
    #
    # And from sphinx.cmdline line 173::
    #
    #    locale = __import__('locale')  # due to submodule of the same name
    #
    # Add these two modules.
    ['inspect', 'locale'])

# Sphinx also relies on a number of data files in its directory hierarchy: for
# example, *.html and *.conf files in sphinx.themes, translation files in
# sphinx.locale, etc.
datas = collect_data_files('sphinx')

# Sphinx 1.3.1 adds additional mandatory dependencies *NOT* detectable by
# PyInstaller: the external "alabaster" and "sphinx_rtd_theme" themes.
if is_module_version('sphinx', '>=', '1.3.1'):
    hiddenimports += ('alabaster', 'sphinx_rtd_theme')
    datas.extend(collect_data_files('alabaster'))
    datas.extend(collect_data_files('sphinx_rtd_theme'))
示例#4
0
# From sphinx.websupport line 100::
#
#    mod = 'sphinx.websupport.search.' + mod
#    SearchClass = getattr(__import__(mod, None, None, [cls]), cls)
#
# So, include modules under ``sphinx.websupport.search``.
                  collect_submodules('sphinx.websupport.search') +
#
# From sphinx.util.inspect line 21::
#
#    inspect = __import__('inspect')
#
# And from sphinx.cmdline line 173::
#
#    locale = __import__('locale')  # due to submodule of the same name
#
# Add these two modules.
                  ['inspect', 'locale'] )

# Sphinx also relies on a number of data files in its directory hierarchy: for
# example, *.html and *.conf files in sphinx.themes, translation files in
# sphinx.locale, etc.
datas = collect_data_files('sphinx')

# Sphinx 1.3.1 adds additional mandatory dependencies *NOT* detectable by
# PyInstaller: the external "alabaster" and "sphinx_rtd_theme" themes.
if is_module_version('sphinx', '>=', '1.3.1'):
    hiddenimports += ('alabaster', 'sphinx_rtd_theme')
    datas.extend(collect_data_files('alabaster'))
    datas.extend(collect_data_files('sphinx_rtd_theme'))