def run(self): # Make sure metadata are up-to-date first. self.run_command('egg_info') reload(pkg_resources) from plover.main import main sys.argv = [' '.join(sys.argv[0:2]) + ' --'] + self.args main()
def run(self): # Make sure metadata are up-to-date first. self.run_command('egg_info') reload(pkg_resources) test_dir = os.path.join(os.path.dirname(__file__), 'test') # Remove __pycache__ directory so pytest does not freak out # when switching between the Linux/Windows versions. pycache = os.path.join(test_dir, '__pycache__') if os.path.exists(pycache): shutil.rmtree(pycache) custom_testsuite = None args = [] for a in self.args: if '-' == a[0]: args.append(a) elif os.path.exists(a): custom_testsuite = a args.append(a) else: args.extend(('-k', a)) if custom_testsuite is None: args.insert(0, test_dir) sys.argv[1:] = args main = pkg_resources.load_entry_point('pytest', 'console_scripts', 'py.test') main()
def pyinstaller(*args): py_args = [ '--log-level=INFO', '--specpath=build', '--additional-hooks-dir=windows', '--paths=.', '--name=%s-%s' % ( __software_name__.capitalize(), __version__, ), '--noconfirm', '--windowed', '--onefile' ] py_args.extend(args) py_args.append('windows/main.py') main = pkg_resources.load_entry_point('PyInstaller', 'console_scripts', 'pyinstaller') main(py_args)
def run(self): # Make sure metadata are up-to-date first. self.run_command('egg_info') reload(pkg_resources) from plover.main import main sys.argv = [' '.join(sys.argv[0:2]) + ' --'] + self.args sys.exit(main())
def run(self): # Make sure metadata are up-to-date first. self.run_command('egg_info') reload(pkg_resources) test_dir = os.path.join(os.path.dirname(__file__), 'test') # Remove __pycache__ directory so pytest does not freak out # when switching between the Linux/Windows versions. pycache = os.path.join(test_dir, '__pycache__') if os.path.exists(pycache): shutil.rmtree(pycache) custom_testsuite = None args = [] for a in self.args: if '-' == a[0]: args.append(a) elif os.path.exists(a): custom_testsuite = a args.append(a) else: args.extend(('-k', a)) if custom_testsuite is None: args.insert(0, test_dir) sys.argv[1:] = args main = pkg_resources.load_entry_point('pytest', 'console_scripts', 'py.test') sys.exit(main())
def pyinstaller(*args): py_args = [ '--log-level=INFO', '--specpath=build', '--additional-hooks-dir=windows', '--name=%s' % PACKAGE, '--noconfirm', '--windowed', '--onefile', ] py_args.extend(args) py_args.append('windows/main.py') main = pkg_resources.load_entry_point('PyInstaller', 'console_scripts', 'pyinstaller') return main(py_args) or 0
def run(self): with self.project_on_sys_path(): from plover.main import main sys.argv = [' '.join(sys.argv[0:2]) + ' --'] + self.args sys.exit(main())
#!/usr/bin/env python2 from plover.main import main main()
if sys.platform.startswith('win'): # First define a modified version of Popen. class _Popen(forking.Popen): def __init__(self, *args, **kw): if hasattr(sys, 'frozen'): # We have to set original _MEIPASS2 value from sys._MEIPASS # to get --onefile mode working. os.putenv('_MEIPASS2', sys._MEIPASS) try: super(_Popen, self).__init__(*args, **kw) finally: if hasattr(sys, 'frozen'): # On some platforms (e.g. AIX) 'os.unsetenv()' is not # available. In those cases we cannot delete the variable # but only set it to the empty string. The bootloader # can handle this case. if hasattr(os, 'unsetenv'): os.unsetenv('_MEIPASS2') else: os.putenv('_MEIPASS2', '') # Second override 'Popen' class with our modified version. forking.Popen = _Popen if __name__ == '__main__': multiprocessing.freeze_support() from plover.main import main main()