示例#1
0
def get_build_exe_options():
    """Get build_exe options with additional includes."""
    opts = freeze.get_build_exe_options(skip_html=True)
    opts['includes'] += pytest.freeze_includes()  # pylint: disable=no-member
    opts['includes'] += ['unittest.mock', 'PyQt5.QtTest']
    opts['packages'].append('qutebrowser')
    return opts
示例#2
0
def get_build_exe_options():
    """Get build_exe options with additional includes."""
    opts = freeze.get_build_exe_options(skip_html=True)
    opts['includes'] += pytest.freeze_includes()  # pylint: disable=no-member
    opts['includes'] += ['unittest.mock', 'PyQt5.QtTest', 'hypothesis', 'bs4']
    opts['packages'].append('qutebrowser')
    return opts
示例#3
0
def get_build_exe_options():
    """Get build_exe options with additional includes."""
    opts = freeze.get_build_exe_options(skip_html=True)
    opts["includes"] += pytest.freeze_includes()  # pylint: disable=no-member
    opts["includes"] += ["unittest.mock", "PyQt5.QtTest", "hypothesis", "bs4"]
    opts["packages"].append("qutebrowser")
    return opts
示例#4
0
def test_freeze_includes():
    """
    Smoke test for freeze_includes(), to ensure that it works across all
    supported python versions.
    """
    includes = pytest.freeze_includes()
    assert len(includes) > 1
    assert '_pytest.genscript' in includes
示例#5
0
def test_freeze_includes():
    """
    Smoke test for freeze_includes(), to ensure that it works across all
    supported python versions.
    """
    includes = pytest.freeze_includes()
    assert len(includes) > 1
    assert '_pytest.genscript' in includes
示例#6
0
def get_build_exe_options():
    """Get build_exe options with additional includes."""
    opts = freeze.get_build_exe_options(skip_html=True)
    opts['includes'] += pytest.freeze_includes()  # pylint: disable=no-member
    opts['includes'] += ['unittest.mock', 'PyQt5.QtTest', 'hypothesis', 'bs4',
                         'httpbin', 'jinja2.ext', 'xvfbwrapper']

    httpbin_dir = os.path.dirname(httpbin.__file__)
    opts['include_files'] += [
        ('tests/integration/data', 'integration/data'),
        (os.path.join(httpbin_dir, 'templates'), 'integration/templates'),
    ]

    opts['packages'].append('qutebrowser')
    return opts
示例#7
0
def get_build_exe_options():
    """Get build_exe options with additional includes."""
    opts = freeze.get_build_exe_options(skip_html=True)
    opts['includes'] += pytest.freeze_includes()
    opts['includes'] += ['unittest.mock', 'PyQt5.QtTest', 'hypothesis', 'bs4',
                         'httpbin', 'jinja2.ext', 'cheroot', 'pstats', 'queue']

    httpbin_dir = os.path.dirname(httpbin.__file__)
    opts['include_files'] += [
        ('tests/end2end/data', 'end2end/data'),
        (os.path.join(httpbin_dir, 'templates'), 'end2end/templates'),
    ]

    opts['packages'].append('qutebrowser')
    return opts
示例#8
0
#-----------------------------------------------------------------------------
# Copyright (c) 2013-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 http://pypi.python.org/pypi/pytest/
"""

import pytest
hiddenimports = pytest.freeze_includes()
示例#9
0
def load_pytest(finder, module):
    import pytest
    for m in pytest.freeze_includes():
        finder.IncludeModule(m)
示例#10
0
# contents of setup.py
from cx_Freeze import setup, Executable
import pytest

setup(
    name="app_main",
    executables=[Executable("app_main.py")],
    options={"build_exe":
        {
        'includes': pytest.freeze_includes()}
        },
    # ... other options
)
示例#11
0
        None,  # Arguments
        None,  # Description
        None,  # Hotkey
        None,  # Icon
        None,  # IconIndex
        None,  # ShowCmd
        'TARGETDIR'  # WkDir
    ),
]

if os.path.exists(MSVC):
    INCLUDE_FILES.append(MSVC)

build_exe_options = {
    "includes":
    pytest.freeze_includes(),
    "include_msvcr":
    True,
    "packages": [
        "os",
        'pytest',
        # "lxml",
        "packaging",
        "six",
        "appdirs",
        # "tests",
        "hathi_checksum"
    ],
    "excludes": ["tkinter"],
    # "namespace_packages": ["tests"],
    "include_files":
示例#12
0
"""
Generates an executable with pytest runner embedded using PyInstaller.
"""
if __name__ == "__main__":
    import pytest
    import subprocess

    hidden = []
    for x in pytest.freeze_includes():
        hidden.extend(["--hidden-import", x])
    hidden.extend(["--hidden-import", "distutils"])
    args = ["pyinstaller", "--noconfirm"] + hidden + ["runtests_script.py"]
    subprocess.check_call(" ".join(args), shell=True)
示例#13
0
def test_freeze():
    print(pytest.freeze_includes())
示例#14
0
"""
Sample setup.py script that generates an executable with pytest runner embedded.
"""
if __name__ == '__main__':
    from cx_Freeze import setup, Executable
    import pytest

    setup(
        name="runtests",
        version="0.1",
        description="exemple of how embedding py.test into an executable using cx_freeze",
        executables=[Executable("runtests_script.py")],
        options={"build_exe": {'includes': pytest.freeze_includes()}},
    )

示例#15
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 http://pypi.python.org/pypi/pytest/
"""

import pytest
hiddenimports = pytest.freeze_includes()
示例#16
0
        "[TARGETDIR]documentation.url",  # Target
        None,  # Arguments
        None,  # Description
        None,  # Hotkey
        None,  # Icon
        None,  # IconIndex
        None,  # ShowCmd
        'TARGETDIR'  # WkDir
    ),
]

if os.path.exists(MSVC):
    INCLUDE_FILES.append(MSVC)

build_exe_options = {
    "includes": ["appdirs"] + pytest.freeze_includes(),
    "include_msvcr":
    True,
    "packages": [
        "os",
        'pytest',
        # "lxml",
        "packaging",
        "six",

        # # "tests",
        "hsw"
    ],
    "excludes": ["tkinter"],
    "include_files":
    INCLUDE_FILES,
示例#17
0
# contents of setup.py
from cx_Freeze import setup, Executable
import pytest

setup(
    name="app_main",
    executables=[Executable("app_main.py")],
    options={"build_exe": {
        'includes': pytest.freeze_includes()
    }},
    # ... other options
)
示例#18
0
        None,  # Arguments
        None,  # Description
        None,  # Hotkey
        None,  # Icon
        None,  # IconIndex
        None,  # ShowCmd
        'TARGETDIR'  # WkDir
    ),
]

if os.path.exists(MSVC):
    INCLUDE_FILES.append(MSVC)

build_exe_options = {
    "includes":
    ["queue", "atexit", "appdirs", 'pkg_resources'] + pytest.freeze_includes(),
    "include_msvcr":
    True,
    "packages": [
        "os", "lxml", "packaging", "six", "appdirs", "hathi_validate",
        "setuptools", "html", "importlib_metadata"
    ],
    "excludes": ["tkinter"],
    "include_files":
    INCLUDE_FILES,
}

version_extractor = re.compile(r"\d+[.]\d+[.]\d+")
version = version_extractor.search(metadata['version']).group(0)

target_name = "hathivalidate.exe" if platform.system(
示例#19
0
    "settings/command_paths.ini",
    "documentation.url",
]
if os.path.exists(MSVC):
    INCLUDE_FILES.append(MSVC)

setup(
    **metadata,
    name=dcc_jp2_converter.FULL_TITLE,
    description=dcc_jp2_converter.__description__,
    version=dcc_jp2_converter.__version__,
    author=dcc_jp2_converter.__author__,
    author_email=dcc_jp2_converter.__author_email__,
    options={
        "build_exe": {
                "includes": ["queue", "atexit", "six", "pyparsing", "appdirs"] + pytest.freeze_includes(),
                "packages": ["os", "packaging"],
                "excludes": ["tkinter"],
                "include_files": INCLUDE_FILES,
                # "include_msvcr": True
            },
        "bdist_msi": {
            "upgrade_code": "{C2DB9F7A-55E3-4EF4-8E15-731CC263AE4C}",
            "data": {
                "Shortcut": shortcut_table,
                "Directory": directory_table
            }
        }
    },
    executables=[Executable("dcc_jp2_converter/scripts/cli.py",
                            targetName=("makejp2.exe" if platform.system() == "Windows" else "makejp2"))]