# -*- mode: python -*- #----------------------------------------------------------------------------- # Copyright (c) 2013, 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. #----------------------------------------------------------------------------- __testname__ = 'test_onefile_pkg_resources' a = Analysis([__testname__ + '.py'], pathex=['.'], hiddenimports=[], hookspath=None, runtime_hooks=None) pyz = PYZ(a.pure) def Datafiles(*filenames, **kw): import os def datafile(path, strip_path=True): parts = path.split('/') path = name = os.path.join(*parts) if strip_path: name = os.path.basename(path) return name, path, 'DATA' strip_path = kw.get('strip_path', True) return TOC( datafile(filename, strip_path=strip_path) for filename in filenames if os.path.isfile(filename)) # Include some data files for testing pkg_resources module. datafile = Datafiles('pkg3/pkg_resources-data.txt', strip_path=False) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, datafile, name= __testname__ + '.exe', debug=True, strip=None, upx=True, console=True )