示例#1
0
 def run(self):
     versions = get_versions(verbose=True)
     with stash(versionfile_path):
         print("updating {}...".format(versionfile_path))
         with open(versionfile_path, 'w') as fh:
             fh.write(short_version_py.format(**versions))
         _build_exe.run(self)
示例#2
0
文件: setup.py 项目: nirev/bonfire
 def run(self):
     versions = get_versions(verbose=True)
     with stash(versionfile_path):
         print("updating {}...".format(versionfile_path))
         with open(versionfile_path, 'w') as fh:
             fh.write(short_version_py.format(**versions))
         _build_exe.run(self)
示例#3
0
 def run(self):
     versions = get_versions(verbose=True)
     target_versionfile = versionfile_source
     print("UPDATING %s" % target_versionfile)
     os.unlink(target_versionfile)
     f = open(target_versionfile, "w")
     f.write(SHORT_VERSION_PY % versions)
     f.close()
     _build_exe.run(self)
     os.unlink(target_versionfile)
     f = open(versionfile_source, "w")
     f.write(
         LONG_VERSION_PY % {
             "DOLLAR":
             "$",
             "TAG_PREFIX":
             tag_prefix,
             "PARENTDIR_PREFIX":
             parentdir_prefix,
             "VERSIONFILE_SOURCE":
             versionfile_source,
             "LOOKUPFILE":
             '"%s"' % lookupfile if lookupfile is not None else "None",
         })
     f.close()
    def run(self):
        command = self.distribution.get_command_obj('build_ext')
        command.run()
        #
        # self.distribution.get_command_obj('build_docs').run()
        build_exe.run(self)

        from inno_setup import COMPILER_PATH
        from docs import ICON, LOGO_SMALL, LOGO_LARGE

        build_base = os.path.split(self.build_exe)[0]
        inno_build_path = os.path.join(build_base, 'inno_setup')

        base_path = os.path.dirname(__file__)
        output_path = os.path.join(base_path, 'output')
        inno_path = os.path.join(base_path, 'inno_setup')

        copyright = self.distribution.executables[0].copyright
        metadata = self.distribution.metadata

        os.remove(os.path.join(self.build_exe, 'EventGhost.pyw'))
        os.remove(os.path.join(self.build_exe, 'Interpreter.py'))

        template = os.path.join(inno_path, 'InnoSetup.template')
        script = os.path.join(inno_build_path, 'inno_setup.iss')

        defines = INNO_SETUP_DEFINES.format(
            name=metadata.name,
            version=metadata.version,
            copyright=copyright.replace('\n', ' '),
            company_name=metadata.name + ' Project',
            url=metadata.url,
            build_dir=self.build_exe,
            output_dir=output_path,
            icon=ICON,
            logo_small=LOGO_SMALL,
            logo_large=LOGO_LARGE)

        with open(template, 'r', encoding='utf-8') as f:
            template = f.read()

        with open(script, 'w', encoding='utf-8') as f:
            f.write(defines)
            f.write(template)

        print('-- building installer ' + '-' * 58)

        proc = Popen('"{0}" "{1}"'.format(COMPILER_PATH, script),
                     stdout=PIPE,
                     stderr=PIPE)

        if sys.version_info[0] >= 3:
            empty_return = b''
        else:
            empty_return = ''

        while proc.poll() is None:
            for line in iter(proc.stdout.readline, empty_return):
                if line:
                    print(line.rstrip().decode('utf-8'))
示例#5
0
 def run(self):
     versions = get_versions(verbose=True)
     target_versionfile = versionfile_source
     print("UPDATING %s" % target_versionfile)
     os.unlink(target_versionfile)
     f = open(target_versionfile, "w")
     f.write(SHORT_VERSION_PY % versions)
     f.close()
     _build_exe.run(self)
     os.unlink(target_versionfile)
     f = open(versionfile_source, "w")
     f.write(LONG_VERSION_PY % {"DOLLAR": "$",
                                "TAG_PREFIX": tag_prefix,
                                "PARENTDIR_PREFIX": parentdir_prefix,
                                "VERSIONFILE_SOURCE": versionfile_source,
                                })
     f.close()
        def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print("UPDATING %s" % target_versionfile)
            os.unlink(target_versionfile)
            with open(target_versionfile, "w") as f:
                f.write(SHORT_VERSION_PY % versions)

            _build_exe.run(self)
            os.unlink(target_versionfile)
            with open(versionfile_source, "w") as f:
                assert VCS is not None, "please set versioneer.VCS"
                LONG = LONG_VERSION_PY[VCS]
                f.write(LONG % {"DOLLAR": "$",
                                "TAG_PREFIX": tag_prefix,
                                "PARENTDIR_PREFIX": parentdir_prefix,
                                "VERSIONFILE_SOURCE": versionfile_source,
                                })
        def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print("UPDATING %s" % target_versionfile)
            os.unlink(target_versionfile)
            with open(target_versionfile, "w") as f:
                f.write(SHORT_VERSION_PY % versions)

            _build_exe.run(self)
            os.unlink(target_versionfile)
            with open(versionfile_source, "w") as f:
                assert VCS is not None, "please set versioneer.VCS"
                LONG = LONG_VERSION_PY[VCS]
                f.write(LONG % {"DOLLAR": "$",
                                "TAG_PREFIX": tag_prefix,
                                "PARENTDIR_PREFIX": parentdir_prefix,
                                "VERSIONFILE_SOURCE": versionfile_source,
                                })
        def run(self):
            cfg = get_config()
            versions = get_versions()
            target_versionfile = cfg.versionfile_source
            print("UPDATING %s" % target_versionfile)
            write_to_version_file(target_versionfile, versions)

            _build_exe.run(self)
            os.unlink(target_versionfile)
            with open(cfg.versionfile_source, "w") as f:
                assert cfg.VCS is not None, "please set versioneer.VCS"
                LONG = LONG_VERSION_PY[cfg.VCS]
                f.write(LONG % {"DOLLAR": "$",
                                "STYLE": cfg.style,
                                "TAG_PREFIX": cfg.tag_prefix,
                                "PARENTDIR_PREFIX": cfg.parentdir_prefix,
                                "VERSIONFILE_SOURCE": cfg.versionfile_source,
                                })
示例#9
0
            def run(self):
                root = get_root()
                cfg = get_config_from_root(root)
                versions = get_versions()
                target_versionfile = cfg.versionfile_source
                print("UPDATING %s" % target_versionfile)
                write_to_version_file(target_versionfile, versions)

                _build_exe.run(self)
                os.unlink(target_versionfile)
                with open(cfg.versionfile_source, "w") as f:
                    LONG = LONG_VERSION_PY[cfg.VCS]
                    f.write(LONG %
                            {"DOLLAR": "$",
                             "STYLE": cfg.style,
                             "TAG_PREFIX": cfg.tag_prefix,
                             "PARENTDIR_PREFIX": cfg.parentdir_prefix,
                             "VERSIONFILE_SOURCE": cfg.versionfile_source,
                             })
示例#10
0
    def run(self):
        _build_exe.run(self)

        # Add egg info of dependencies
        for dist in pkg_resources.require('pymontecarlo'):
            egg_info_dirpath = dist._provider.egg_info or dist._provider.path
            if egg_info_dirpath is None:
                log.warn('No egg-info found for project %s' % dist.project_name)
                continue

            if os.path.isdir(egg_info_dirpath):
                if os.path.basename(egg_info_dirpath) == 'EGG-INFO':
                    dst = os.path.join(self.build_exe, dist.egg_name() + '.egg-info')
                else:
                    dst = os.path.join(self.build_exe,
                                       os.path.basename(egg_info_dirpath))
                copy_tree(egg_info_dirpath, dst)
            else:
                copy_file(egg_info_dirpath, self.build_exe)
示例#11
0
      def run(self):
         versions = get_versions(verbose=True)
         target_versionfile = versionfile_source
         print('UPDATING {}'.format(target_versionfile))
         os_unlink(target_versionfile)
         with open(target_versionfile, 'w') as f:
            f.write(SHORT_VERSION_PY % versions)

         _build_exe.run(self)
         os_unlink(target_versionfile)
         # noinspection PyTypeChecker
         with open(versionfile_source, 'w') as f:
            assert VCS is not None, 'please set versioneer.VCS'
            # noinspection PyPep8Naming
            LONG = LONG_VERSION_PY[VCS]
            f.write(LONG % {
               'DOLLAR': '$',
               'TAG_PREFIX': tag_prefix,
               'PARENTDIR_PREFIX': parentdir_prefix,
               'VERSIONFILE_SOURCE': versionfile_source,
            })
示例#12
0
        def run(self):
            versions = get_versions(verbose=True)
            target_versionfile = versionfile_source
            print('UPDATING {}'.format(target_versionfile))
            os_unlink(target_versionfile)
            with open(target_versionfile, 'w') as f:
                f.write(SHORT_VERSION_PY % versions)

            _build_exe.run(self)
            os_unlink(target_versionfile)
            # noinspection PyTypeChecker
            with open(versionfile_source, 'w') as f:
                assert VCS is not None, 'please set versioneer.VCS'
                # noinspection PyPep8Naming
                LONG = LONG_VERSION_PY[VCS]
                f.write(
                    LONG % {
                        'DOLLAR': '$',
                        'TAG_PREFIX': tag_prefix,
                        'PARENTDIR_PREFIX': parentdir_prefix,
                        'VERSIONFILE_SOURCE': versionfile_source,
                    })
示例#13
0
        def run(self):
            # Start by running the normal stuff
            _build_exe.run(self)

            # Now overwrite the static version file with our actual version
            _write_version(os.path.join(self.build_exe, STATIC_VERSION_FILE))

            # The validator_collection library incorrectly accesses its
            #  own _version.py file (using __file__, which is not cx_Freeze compatible)

            # Delete any existing _version.py file for the validator_collection library
            destination = os.path.join(self.build_exe, "lib",
                                       "validator_collection", "_version.py")
            try:
                os.remove(destination)
            except Exception:
                pass

            # Create a dummy _version.py file (which is actually our own
            #  version number, not validator_collection's -- doesn't matter)
            with open(destination, "w") as f:
                f.write("__version__ = '{}'\n".format(__version__))
示例#14
0
文件: Inno.py 项目: iaz3/TCBot
    def run(self):
        build_exe.run(self)

        script = InnoScript(self)
        script.Create()
        script.compile()