(self)
Run build_exe command.
Run build_exe command.
Run build_exe command .
def run(self):
            """Run build_exe command."""
            build_icon()
            build_docs()
            # only include 32-bit DLLs
            build_manifest(INCLUDE_FILES + ('pcbasic/lib/win32_x86/*',), EXCLUDE_FILES)
            cx_Freeze.build_exe.run(self)
            build_dir = 'build/exe.{}/'.format(PLATFORM_TAG)
            # build_exe just includes everything inside the directory
            # so remove some stuff we don't need
            for root, _, files in os.walk(build_dir + 'lib'):
                testing = set(root.split(os.sep)) & set(('test', 'tests', 'testing', 'examples'))
                for fname in files:
                    name = os.path.join(root, fname)
                    if (
                            # remove superfluous copies of python27.dll in lib/
                            # as there is a copy in the package root already
                            fname.lower() == 'python27.dll' or fname.lower() == 'msvcr90.dll'
                            # remove tests and examples
                            or testing
                            # we're only producing packages for win32_x86
                            or 'win32_x64' in name or name.endswith('.dylib')
                        ):
                        remove(name)
            # remove lib dir altogether to avoid it getting copied into the msi
            # as everything in there is copied once already
            prune('build/lib')
            # remove c++ runtime etc
            # these were on python 2.7
            remove(build_dir + 'msvcm90.dll')
            remove(build_dir + 'msvcp90.dll')
            # chunky libs on python3.7 that I don't think we use
            remove(build_dir + 'lib/libcrypto-1_1.dll')
            remove(build_dir + 'lib/libssl-1_1.dll')
            # remove modules that can be left out
            for module in ('distutils', 'setuptools', 'pydoc_data'):
                prune(build_dir + 'lib/%s' % module)
def run ( self ) : build_icon ( ) build_docs ( ) # only include 32-bit DLLs build_manifest ( INCLUDE_FILES + ( 'pcbasic/lib/win32_x86/*' , ) , EXCLUDE_FILES ) cx_Freeze . build_exe . run ( self ) build_dir = 'build/exe.{}/' . format ( PLATFORM_TAG ) # build_exe just includes everything inside the directory # so remove some stuff we don't need for root , _ , files in os . walk ( build_dir + 'lib' ) : testing = set ( root . split ( os . sep ) ) & set ( ( 'test' , 'tests' , 'testing' , 'examples' ) ) for fname in files : name = os . path . join ( root , fname ) if ( # remove superfluous copies of python27.dll in lib/ # as there is a copy in the package root already fname . lower ( ) == 'python27.dll' or fname . lower ( ) == 'msvcr90.dll' # remove tests and examples or testing # we're only producing packages for win32_x86 or 'win32_x64' in name or name . endswith ( '.dylib' ) ) : remove ( name ) # remove lib dir altogether to avoid it getting copied into the msi # as everything in there is copied once already prune ( 'build/lib' ) # remove c++ runtime etc # these were on python 2.7 remove ( build_dir + 'msvcm90.dll' ) remove ( build_dir + 'msvcp90.dll' ) # chunky libs on python3.7 that I don't think we use remove ( build_dir + 'lib/libcrypto-1_1.dll' ) remove ( build_dir + 'lib/libssl-1_1.dll' ) # remove modules that can be left out for module in ( 'distutils' , 'setuptools' , 'pydoc_data' ) : prune ( build_dir + 'lib/%s' % module )