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
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
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
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
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
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
#----------------------------------------------------------------------------- # 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()
def load_pytest(finder, module): import pytest for m in pytest.freeze_includes(): finder.IncludeModule(m)
# 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 )
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":
""" 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)
def test_freeze(): print(pytest.freeze_includes())
""" 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()}}, )
#----------------------------------------------------------------------------- # 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()
"[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,
# 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 )
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(
"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"))]