#-----------------------------------------------------------------------------
# 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

from PyInstaller.compat import getsitepackages, is_darwin, is_win
from PyInstaller.utils.hooks import qt4_menu_nib_dir

# On Windows system PATH has to be extended to point to the PySide 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, 'PySide') for x in getsitepackages()])

# For Qt to work on Mac OS X it is necessary to include directory qt_menu.nib.
# This directory contains some resource files necessary to run PyQt or PySide
# app.
if is_darwin:
    datas = [
        (qt4_menu_nib_dir(), ''),
    ]
示例#2
0
#-----------------------------------------------------------------------------


import os

from PyInstaller.utils.hooks import (
    get_module_attribute, is_module_satisfies, qt5_menu_nib_dir)
from PyInstaller.compat import getsitepackages, is_darwin, is_win


# On Windows system PATH has to be extended to point to the PyQt5 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, 'PyQt5') for x in getsitepackages()])


# In the new consolidated mode any PyQt depends on _qt
hiddenimports = ['sip', 'PyQt5.Qt']


# For Qt<5.4 to work on Mac OS X it is necessary to include `qt_menu.nib`.
# This directory contains some resource files necessary to run PyQt or PySide
# app.
if is_darwin:
    # Version of the currently installed Qt 5.x shared library.
    qt_version = get_module_attribute('PyQt5.QtCore', 'QT_VERSION_STR')
    if is_module_satisfies('Qt < 5.4', qt_version):
        datas = [(qt5_menu_nib_dir(), '')]
示例#3
0
# 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

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')]
示例#4
0
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')
]
示例#5
0
#excludedimports = ["numpy.testing"]

# FIXME check if this workaround is still necessary!
if is_win:
    from PyInstaller.utils.win32.winutils import extend_system_path
    from distutils.sysconfig import get_python_lib
    # SciPy/Numpy Windows builds from http://www.lfd.uci.edu/~gohlke/pythonlibs
    # contain some dlls in directory like C:\Python27\Lib\site-packages\numpy\core\
    numpy_core_paths = [os.path.join(get_python_lib(), 'numpy', 'core')]
    # In virtualenv numpy might be installed directly in real prefix path.
    # Then include this path too.
    if is_venv:
        numpy_core_paths.append(
            os.path.join(base_prefix, 'Lib', 'site-packages', 'numpy', 'core')
        )
    extend_system_path(numpy_core_paths)
    del numpy_core_paths

# if we bundle the testing module, this will cause
# `scipy` to be pulled in unintentionally but numpy imports
# numpy.testing at the top level for historical reasons.
# excludedimports = collect_submodules('numpy.testing')

binaries = []

# package the DLL bundle that official numpy wheels for Windows ship
# The DLL bundle will either be in extra-dll on windows proper
# and in .libs if installed on a virtualenv created from MinGW (Git-Bash
# for example)
if is_win:
    extra_dll_locations = ['extra-dll', '.libs']