from esky.bdist_esky import Executable from distutils.core import setup from setup import NAME, BASEVERSION exe = Executable("gui.py") DATA_FILES = ['tools/avrdude.exe', 'avrdude.conf'] OPTIONS = { "bdist_esky": { "freezer_module": "cxfreeze", "freezer_options": { 'includes': ['PyQt4', 'PyQt4.QtCore', 'PyQt4.QtGui'], 'excludes': [ 'PyQt4.QtDesigner', 'PyQt4.QtNetwork', 'PyQt4.QtOpenGL', 'PyQt4.QtScript', 'PyQt4.QtSql', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml', 'PyQt4.phonon' ] } } } setup(name=NAME, options=OPTIONS, data_files=DATA_FILES, version=BASEVERSION, scripts=[exe])
#setup( # name = "example-app", # version = "0.2", # scripts = ["example.py"], # options = {"bdist_esky": { # "freezer_module":"py2exe", # }} #) # Using py2app #setup( # name = "example-app", # version = "0.2", # scripts = ["example.py"], # options = {"bdist_esky": { # "freezer_module":"py2app" # }} # ) # cx freeze from esky.bdist_esky import Executable setup( name='example-app', version='0.2', #executables=[Executable('example.py')], options={"bdist_esky": { "freezer_module": "cxfreeze" }}, scripts=[Executable('example.py')], )
# I can use this to fool py2exe! Docs - #http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls origIsSystemDLL = py2exe.build_exe.isSystemDLL def isSystemDLL(pathname): if os.path.basename(pathname).lower() in ("msvcp90.dll", "gdiplus.dll", "msvcr71.dll"): return 0 return origIsSystemDLL(pathname) py2exe.build_exe.isSystemDLL = isSystemDLL mdatasync_target = Executable( gui_only=True, description="Application to sync data from clients to server", script="main.py", dest_base="mdatasync") mssimulator_target = Executable( gui_only=True, description="A tool to generate sample mass spec files from worklists", script="Simulator.py", dest_base="simulator") scripts = [mdatasync_target, mssimulator_target] setup( name='msDataSync', version=VERSION, description='msDataSync application',
def _run_eskytester(self, options): """Build and run the eskytester app using the given distutils options. The "eskytester" application can be found next to this file, and the sequence of tests performed range across "script1.py" to "script3.py". """ olddir = os.path.abspath(os.curdir) # tdir = os.path.join(os.path.dirname(__file__),"DIST") # if os.path.exists(tdir): # really_rmtree(tdir) # os.mkdir(tdir) tdir = tempfile.mkdtemp() server = None script2 = None try: options.setdefault("build", {})["build_base"] = os.path.join(tdir, "build") options.setdefault("bdist", {})["dist_dir"] = os.path.join(tdir, "dist") # Set some callbacks to test that they work correctly options.setdefault("bdist_esky", {}).setdefault( "pre_freeze_callback", "esky.tests.test_esky.assert_freezedir_exists") options.setdefault("bdist_esky", {}).setdefault("pre_zip_callback", assert_freezedir_exists) options["bdist_esky"].setdefault("excludes", []).extend(["Tkinter", "tkinter"]) platform = get_platform() deploydir = "deploy.%s" % (platform, ) esky_root = dirname(dirname(dirname(__file__))) os.chdir(tdir) shutil.copytree( os.path.join(esky_root, "esky", "tests", "eskytester"), "eskytester") dir_util._path_created.clear() # Build three increasing versions of the test package. # Version 0.2 will include a bundled MSVCRT on win32. # Version 0.3 will be distributed as a patch. metadata = dict( name="eskytester", packages=["eskytester"], author="rfk", description="the esky test package", data_files=[("data", ["eskytester/datafile.txt"])], package_data={"eskytester": ["pkgdata.txt"]}, ) options2 = options.copy() options2["bdist_esky"] = options["bdist_esky"].copy() options2["bdist_esky"]["bundle_msvcrt"] = True script1 = "eskytester/script1.py" script2 = Executable([None, open("eskytester/script2.py")], name="script2") script3 = "eskytester/script3.py" dist_setup(version="0.1", scripts=[script1], options=options, script_args=["bdist_esky"], **metadata) dist_setup(version="0.2", scripts=[script1, script2], options=options2, script_args=["bdist_esky"], **metadata) dist_setup(version="0.3", scripts=[script2, script3], options=options, script_args=["bdist_esky_patch"], **metadata) os.unlink( os.path.join(tdir, "dist", "eskytester-0.3.%s.zip" % (platform, ))) # Check that the patches apply cleanly uzdir = os.path.join(tdir, "unzip") deep_extract_zipfile( os.path.join(tdir, "dist", "eskytester-0.1.%s.zip" % (platform, )), uzdir) with open( os.path.join( tdir, "dist", "eskytester-0.3.%s.from-0.1.patch" % (platform, )), "rb") as f: esky.patch.apply_patch(uzdir, f) really_rmtree(uzdir) deep_extract_zipfile( os.path.join(tdir, "dist", "eskytester-0.2.%s.zip" % (platform, )), uzdir) with open( os.path.join( tdir, "dist", "eskytester-0.3.%s.from-0.2.patch" % (platform, )), "rb") as f: esky.patch.apply_patch(uzdir, f) really_rmtree(uzdir) # Serve the updates at LOCAL_HTTP_PORT set in esky.util print "running local update server" try: server = HTTPServer(("localhost", LOCAL_HTTP_PORT), SimpleHTTPRequestHandler) except Exception: # in travis ci we start our own server pass else: server_thread = threading.Thread(target=server.serve_forever) server_thread.daemon = True server_thread.start() # Set up the deployed esky environment for the initial version zfname = os.path.join(tdir, "dist", "eskytester-0.1.%s.zip" % (platform, )) os.mkdir(deploydir) extract_zipfile(zfname, deploydir) # Run the scripts in order. if options["bdist_esky"]["freezer_module"] == "py2app": appdir = os.path.join(deploydir, os.listdir(deploydir)[0]) cmd1 = os.path.join(appdir, "Contents", "MacOS", "script1") cmd2 = os.path.join(appdir, "Contents", "MacOS", "script2") cmd3 = os.path.join(appdir, "Contents", "MacOS", "script3") else: appdir = deploydir if sys.platform == "win32": cmd1 = os.path.join(deploydir, "script1.exe") cmd2 = os.path.join(deploydir, "script2.exe") cmd3 = os.path.join(deploydir, "script3.exe") else: cmd1 = os.path.join(deploydir, "script1") cmd2 = os.path.join(deploydir, "script2") cmd3 = os.path.join(deploydir, "script3") print "spawning eskytester script1", options["bdist_esky"][ "freezer_module"] os.unlink( os.path.join(tdir, "dist", "eskytester-0.1.%s.zip" % (platform, ))) p = subprocess.Popen(cmd1) assert p.wait() == 0 os.unlink(os.path.join(appdir, "tests-completed")) print "spawning eskytester script2" os.unlink( os.path.join(tdir, "dist", "eskytester-0.2.%s.zip" % (platform, ))) p = subprocess.Popen(cmd2) assert p.wait() == 0 os.unlink(os.path.join(appdir, "tests-completed")) print "spawning eskytester script3" p = subprocess.Popen(cmd3) assert p.wait() == 0 os.unlink(os.path.join(appdir, "tests-completed")) finally: if script2: script2.script[1].close() os.chdir(olddir) if sys.platform == "win32": # wait for the cleanup-at-exit pocess to finish time.sleep(4) really_rmtree(tdir) if server: server.shutdown()
from esky.bdist_esky import Executable from distutils.core import setup from setup import APP, OPTIONS, BASEVERSION, VERSION, NAME exe = Executable(APP) DATA_FILES = ['tools/avrdude', 'avrdude.conf'] OPTIONS = { "bdist_esky": { "freezer_module": "py2app", "freezer_options": { 'includes': ['PyQt4', 'PyQt4.QtCore', 'PyQt4.QtGui'], 'excludes': [ 'PyQt4.QtDesigner', 'PyQt4.QtNetwork', 'PyQt4.QtOpenGL', 'PyQt4.QtScript', 'PyQt4.QtSql', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml', 'PyQt4.phonon' ], 'argv_emulation': True, 'emulate-shell-environment': True, 'iconfile': 'Icon.icns', 'plist': 'Info.plist' } } } setup(
# since matplotlib v1 import matplotlib matplotlibdata_files = matplotlib.get_py2exe_datafiles() #del matplotlibdata_files[-1] data_files = [('Microsoft.VC90.CRT', ('Microsoft.VC90.CRT.manifest', 'msvcr90.dll', 'msvcm90.dll', 'msvcp90.dll'))] data_files = data_files + matplotlibdata_files run_sat = Executable( 'satellite.py', # give our app the standard Python icon icon='satellite.ico', # we could make the app gui-only by setting this to True gui_only=True, # any other keyword args would be passed on to py2exe ) setup( options=options, scripts=[run_sat], # use out build_installer class as extended py2exe build name="Satellite", version=__version__, description="", author="David Trémouilles, Dimitri Linten", author_email="[email protected], [email protected]", url="http://code.google.com/p/esdanalysistools/", data_files=data_files)
from esky.bdist_esky import Executable from distutils.core import setup setup( name = "avdump-gui", version = "2.1.8", scripts = [ Executable( "avdump2gui.pyw", icon='anidb.ico', gui_only=True ) ], options = { "bdist_esky": { "freezer_module" : "py2exe", "freezer_options" : { "optimize" : 2, "bundle_files" : 3, "compressed" : True, "packages" : ['sip'], "dll_excludes" : [ 'w9xpopen.exe', 'mswsock.dll', 'powrprof.dll' ] } } }, data_files = [ 'msvcp90.dll',
'excludes': freeze_excludes, 'compressed': 'True', "optimize": 2, 'bundle_files': 3, 'dll_excludes': ['w9xpopen.exe'] } bdist_esky_options_py2exe = { "freezer_options": py2exe_options, "freezer_module": "py2exe" } iquality_exe = Executable(name='iQuality', gui_only=GUI_ONLY, description='High Quality Songs Downloader', script=os.path.join(code_dir, "code", "Gui.py"), icon_resources=[ (1, os.path.join(code_dir, "code", "pics", "iQUACK.ico")) ]) setup( name="iQuality", version=__version__, description='High Quality Songs Downloader', author='Itay Brandes', author_email='*****@*****.**', url='http://iquality.itayb.net/', data_files=py2exe_data_files, # windows = [{"script": os.path.join(code_dir, "code", "Gui.py"), # 'uac_info': "requireAdministrator",
PACKAGES = ['cx_Oracle'] # default location site_dir = site.getsitepackages()[1] DYNAMIC_DLLS = [] if DYNAMIC_DLLS: tmp = [] for dll in DYNAMIC_DLLS: tmp.append(os.path.join(site_dir, dll)) ADDITIONAL_FILES.append(('.', tmp)) MAIN_SCRIPT = 'mask_ecal_detect.py' # MAIN_SCRIPT = 'er.bat' EXE = Executable(script=MAIN_SCRIPT, gui_only=True, name=app_name) print('=== Compiling {0} ==='.format(app_name)) setup( name=app_name, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, version=BUILD_VERSION, data_files=ADDITIONAL_FILES, scripts=[EXE], options={ 'bdist_esky': { 'excludes': EXCLUDES, 'includes': INCLUDES, 'bundle_msvcrt': True,
root, os.path.join(directory, os.path.pardir)) results.append((targetdir, files)) return results if sys.platform in ['win32', 'cygwin', 'win64']: # Add http files data_files = get_data_files([r'../app/src/httpdocs' ]) + [r'../app/src/local_server.pyc'] # We can customise the executable's creation by passing an instance # of Executable() instead of just the script name. exe = Executable( '../app/src/main.py', icon='../resources/images/Pie-chart.ico', gui_only=True, name=exeName, ) setup( data_files=data_files, name=appName, version=assetjet.__version__, scripts=[exe], options={ 'bdist_esky': { # forcibly include some other modules 'includes': [ 'lxml.etree', 'lxml._elementpath', 'gzip', 'numpy', 'PySide.QtWebKit', 'PySide.QtNetwork', 'PySide.QtSvg' ],
import os, sys from esky.bdist_esky import Executable from distutils.core import setup # We can customuse the executable's creation by passing an instance # of Executable() instead of just the script name. example = Executable( "example.py", # give our app the standard Python icon icon=os.path.join(sys.prefix, "DLLs", "py.ico"), # we could make the app gui-only by setting this to True gui_only=False, # any other keyword args would be passed on to py2exe ) setup( name="example-app", version="0.4", scripts=[example], options={ "bdist_esky": { # forcibly include some other modules "includes": ["SocketServer", "email"], # forcibly exclude some other modules "excludes": ["pydoc"], # force esky to freeze the app using py2exe "freezer_module": "py2exe", # tweak the options used by py2exe "freezer_options": { "bundle_files": 3, "compressed": True
includes = ['ui', 'scipy.special._ufuncs_cxx', 'matplotlib.backends.backend_qt4agg', 'atexit', 'matplotlib.backends.backend_tkagg', 'scipy.sparse.csgraph._validation', 'pyqtgraph', 'pyqtgraph.graphicsItems.BarGraphItem', 'scipy.integrate.vode', 'scipy.integrate.lsoda'], excludes = ['tornado', 'IPython', 'PyQt5', 'PyQt4' 'webbrowser'], freezer_module="cx_freeze" ) data_files = [('.', ['icons_rc.py'])] import sys suff = ".exe" if sys.platform == 'win32' else "" executables = [ Executable('main.py', name="Fourierism"+suff, gui_only=True) ] try: with open('buildfile.txt', 'r+') as file: version = int(file.read()) file.seek(0) file.write(str(version+1)) except OSError: version = 0 setup( name='Fourierism', version='0.1-%d' % version, description='', options=dict(bdist_esky=buildOptions), scripts=executables,
'gui_scripts': [ 'swcnts4squints = swcnts4squints:main', ], }, **extra_options ) for f in py_files: os.remove(f) else: extra_options = {} if sys.platform == 'darwin': #extra_options = dict(setup_requires=['py2app'], extra_options = dict(app=['swcnts4squints/swcnts4squints.py'], scripts=[Executable('swcnts4squints/swcnts4squints.py',)], options={'bdist_esky': {'freezer_module': 'py2app', 'freezer_options': {"argv_emulation": True, "iconfile": 'images/swcnts4squints.icns', "includes": ['sip', 'PyQt4.QtCore', 'PyQt4.QtGui']}}}) setup(name='swcnts4squints', version=0.5, description="python scripts", long_description="""\ Simple app for calculating physical properties of carbon nanotubes""", classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='python scripts',