def main(): parser = optparse.OptionParser( usage= 'python %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>') __add_options(parser) PyInstaller.makespec.__add_options(parser) PyInstaller.build.__add_options(parser) PyInstaller.log.__add_options(parser) PyInstaller.compat.__add_obsolete_options(parser) opts, args = parser.parse_args() PyInstaller.log.__process_options(parser, opts) # Print program version and exit if opts.version: print get_version() raise SystemExit(0) if not args: parser.error('Requires at least one scriptname file ' 'or exactly one .spec-file') # Skip creating .spec when .spec file is supplied if args[0].endswith('.spec'): spec_file = args[0] else: spec_file = run_makespec(opts, args) run_build(opts, spec_file)
def main(): parser = optparse.OptionParser(usage="python %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>") __add_options(parser) PyInstaller.makespec.__add_options(parser) PyInstaller.build.__add_options(parser) PyInstaller.log.__add_options(parser) PyInstaller.compat.__add_obsolete_options(parser) opts, args = parser.parse_args() PyInstaller.log.__process_options(parser, opts) # Print program version and exit if opts.version: print get_version() raise SystemExit(0) if not args: parser.error("Requires at least one scriptname file " "or exactly one .spec-file") # Skip creating .spec when .spec file is supplied if args[0].endswith(".spec"): spec_file = args[0] else: spec_file = run_makespec(opts, args) run_build(opts, spec_file)
def run(pyi_args=sys.argv[1:], pyi_config=None): """ pyi_args allows running PyInstaller programatically without a subprocess pyi_config allows checking configuration once when running multiple tests """ misc.check_not_running_as_root() try: parser = optparse.OptionParser( usage= 'python %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>' ) __add_options(parser) PyInstaller.makespec.__add_options(parser) PyInstaller.build.__add_options(parser) PyInstaller.log.__add_options(parser) PyInstaller.compat.__add_obsolete_options(parser) opts, args = parser.parse_args(pyi_args) PyInstaller.log.__process_options(parser, opts) # Print program version and exit if opts.version: print get_version() raise SystemExit(0) if not args: parser.error('Requires at least one scriptname file ' 'or exactly one .spec-file') # Skip creating .spec when .spec file is supplied if args[0].endswith('.spec'): spec_file = args[0] else: spec_file = run_makespec(opts, args) run_build(opts, spec_file, pyi_config) except KeyboardInterrupt: raise SystemExit("Aborted by user request.")
def run(pyi_args=sys.argv[1:], pyi_config=None): """ pyi_args allows running PyInstaller programatically without a subprocess pyi_config allows checking configuration once when running multiple tests """ misc.check_not_running_as_root() try: parser = optparse.OptionParser( usage='%prog [opts] <scriptname> [ <scriptname> ...] | <specfile>' ) __add_options(parser) PyInstaller.makespec.__add_options(parser) PyInstaller.build.__add_options(parser) PyInstaller.log.__add_options(parser) PyInstaller.compat.__add_obsolete_options(parser) opts, args = parser.parse_args(pyi_args) PyInstaller.log.__process_options(parser, opts) # Print program version and exit if opts.version: print get_version() raise SystemExit(0) if not args: parser.error('Requires at least one scriptname file ' 'or exactly one .spec-file') # Skip creating .spec when .spec file is supplied if args[0].endswith('.spec'): spec_file = args[0] else: spec_file = run_makespec(opts, args) run_build(opts, spec_file, pyi_config) except KeyboardInterrupt: raise SystemExit("Aborted by user request.")
def main(configfilename, upx_dir, **kw): if is_darwin and compat.architecture() == '64bit': logger.warn( 'You are running 64-bit Python. Created binary will not' ' work on Mac OS X 10.4 or 10.5. For this version it is necessary' ' to create 32-bit binaries.' ' If you need 32-bit version of Python, run Python as 32-bit binary' ' by command:\n\n' ' arch -i386 python\n') # wait several seconds for user to see this message time.sleep(4) try: config = build._load_data(configfilename) logger.info('read old config from %s', configfilename) except (IOError, SyntaxError): # IOerror: file not present/readable # SyntaxError: invalid file (platform change?) # if not set by Make.py we can assume Windows config = {'useELFEXE': 1} # Save Python version, to detect and avoid conflicts config["pythonVersion"] = sys.version config["pythonDebug"] = __debug__ # Save PyInstaller path and version config["pyinstaller_version"] = get_version() config["pyinstaller_homepath"] = HOMEPATH find_EXE_dependencies(config) test_TCL_TK(config) test_Zlib(config) test_Crypt(config) test_RsrcUpdate(config) test_unicode(config) test_UPX(config, upx_dir) find_PYZ_dependencies(config) build._save_data(configfilename, config) logger.info("done generating %s", configfilename)
def main(configfilename, upx_dir, **kw): if is_darwin and compat.architecture() == '64bit': logger.warn('You are running 64-bit Python. Created binary will not' ' work on Mac OS X 10.4 or 10.5. For this version it is necessary' ' to create 32-bit binaries.' ' If you need 32-bit version of Python, run Python as 32-bit binary' ' by command:\n\n' ' arch -i386 python\n') # wait several seconds for user to see this message time.sleep(4) try: config = build._load_data(configfilename) logger.info('read old config from %s', configfilename) except (IOError, SyntaxError): # IOerror: file not present/readable # SyntaxError: invalid file (platform change?) # if not set by Make.py we can assume Windows config = {'useELFEXE': 1} # Save Python version, to detect and avoid conflicts config["pythonVersion"] = sys.version config["pythonDebug"] = __debug__ # Save PyInstaller path and version config["pyinstaller_version"] = get_version() config["pyinstaller_homepath"] = HOMEPATH find_EXE_dependencies(config) test_TCL_TK(config) test_Zlib(config) test_Crypt(config) test_RsrcUpdate(config) test_unicode(config) test_UPX(config, upx_dir) find_PYZ_dependencies(config) build._save_data(configfilename, config) logger.info("done generating %s", configfilename)
class my_sdist(sdist): def make_release_tree(self, base_dir, files): res = sdist.make_release_tree(self, base_dir, files) build_py = self.get_finalized_command('build_py') filename = build_py.get_module_outfile( base_dir, ['PyInstaller', 'utils'], 'git') _write_git_version_file(filename) return res setup( install_requires=['setuptools'], name='PyInstaller', version=get_version(), description=DESC, long_description=LONG_DESC, keywords='packaging, standalone executable, pyinstaller, macholib, freeze, py2exe, py2app, bbfreeze', author='Giovanni Bajo, Hartmut Goebel, Martin Zibricky', author_email='*****@*****.**', maintainer='Giovanni Bajo, Hartmut Goebel, Martin Zibricky', maintainer_email='*****@*****.**', license=('GPL license with a special exception which allows to use ' 'PyInstaller to build and distribute non-free programs ' '(including commercial ones)'), url='http://www.pyinstaller.org', download_url='https://sourceforge.net/projects/pyinstaller/files',
Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 2 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: System :: Installation/Setup Classifier: Topic :: System :: Software Distribution Classifier: Topic :: Utilities """.splitlines() setup( install_requires=['distribute'], name='PyInstaller', version=get_version(), description=DESC, long_description=LONG_DESC, keywords= 'packaging, standalone executable, pyinstaller, macholib, freeze, py2exe, py2app, bbfreeze', author='Giovanni Bajo, Hartmut Goebel, Martin Zibricky', author_email='*****@*****.**', maintainer='Giovanni Bajo, Hartmut Goebel, Martin Zibricky', maintainer_email='*****@*****.**', license= 'GPL license with a special exception which allows to use PyInstaller \ to build and distribute non-free programs (including commercial ones)', url='http://www.pyinstaller.org', download_url='https://sourceforge.net/projects/pyinstaller/files', classifiers=CLASSIFIERS, zip_safe=False,
def __test_PyInstaller(): try: from PyInstaller import get_version return get_version() except ImportError: __error("cannot import PyInstaller")
def pyversion(installdir): config = controller.getConfig() sys.path.insert(0, installdir) from PyInstaller import get_version return float(get_version()[:3])