def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') isdev = parser.getboolean('package', 'version.dev') revision = parser.getint('package', 'version.revision') version = strversion if isdev: version += '-dev-r%d' % (revision,) trunk_url = self._repo_url() if not trunk_url.endswith('/trunk'): rex = _re.compile(r'/branches/\d+(?:\.\d+)*\.[xX]$').search match = rex(trunk_url) if not match: make.fail("Not in trunk or release branch!") found = match.start(0) else: found = -len('/trunk') release_url = trunk_url[:found] + '/releases/' + version svn = shell.frompath('svn') shell.spawn( svn, 'copy', '-m', 'Release version ' + version, '--', trunk_url, release_url, echo=True, )
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') version = strversion trunk_url = self._repo_url() if not trunk_url.endswith('/trunk'): rex = _re.compile(r'/branches/\d+(?:\.\d+)*\.[xX]$').search match = rex(trunk_url) if not match: make.fail("Not in trunk or release branch!") found = match.start(0) else: found = -len('/trunk') release_url = trunk_url[:found] + '/releases/' + version svn = shell.frompath('svn') shell.spawn( svn, 'copy', '-m', 'Release version ' + version, '--', trunk_url, release_url, echo=True, )
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read("package.cfg", **cfgread) strversion = parser.get("package", "version.number") isdev = parser.getboolean("package", "version.dev") revision = parser.getint("package", "version.revision") version = strversion if isdev: version += "-dev-r%d" % (revision,) trunk_url = self._repo_url() if not trunk_url.endswith("/trunk"): rex = _re.compile(r"/branches/\d+(?:\.\d+)*\.[xX]$").search match = rex(trunk_url) if not match: make.fail("Not in trunk or release branch!") found = match.start(0) else: found = -len("/trunk") release_url = trunk_url[:found] + "/releases/" + version svn = shell.frompath("svn") shell.spawn(svn, "copy", "-m", "Release version " + version, "--", trunk_url, release_url, echo=True)
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') isdev = parser.getboolean('package', 'version.dev') revision = parser.getint('package', 'version.revision') self._version_init(strversion, isdev, revision) self._version_userdoc(strversion, isdev, revision) # self._version_download(strversion, isdev, revision) self._version_changes(strversion, isdev, revision)
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') version = strversion git = shell.frompath('git') shell.spawn( git, 'tag', '-a', '-m', 'Release version ' + version, '--', version, echo=True, )
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read("package.cfg", **cfgread) strversion = parser.get("package", "version.number") isdev = parser.getboolean("package", "version.dev") revision = parser.getint("package", "version.revision") version = strversion if isdev: version += "-dev-r%d" % (revision,) git = shell.frompath("git") shell.spawn(git, "tag", "-a", "-m", "Release version " + version, "--", version, echo=True)
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') isdev = parser.getboolean('package', 'version.dev') revision = parser.getint('package', 'version.revision') version = strversion if isdev: version += '-dev-r%d' % (revision,) git = shell.frompath('git') shell.spawn( git, 'tag', '-a', '-m', 'Release version ' + version, '--', version, echo=True, )
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') self._version_init(strversion) self._version_userdoc(strversion) self._version_download(strversion) self._version_changes(strversion) parm = {'VERSION': strversion} for src, dest in self.ebuild_files.items(): src = "%s/%s" % (self.dirs['ebuild'], src) dest = "%s/%s" % (self.dirs['ebuild'], dest % parm) term.green("Creating %(name)s...", name=dest) shell.cp(src, dest)
def _tag_release(self): """ Tag release """ from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') isdev = parser.getboolean('package', 'version.dev') revision = parser.getint('package', 'version.revision') version = strversion if isdev: version += '.dev%d' % (revision,) git = shell.frompath('git') shell.spawn( git, 'tag', '-a', '-m', 'Release version ' + version, '--', version, echo=True, )
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read("package.cfg", **cfgread) strversion = parser.get("package", "version.number") isdev = parser.getboolean("package", "version.dev") revision = parser.getint("package", "version.revision") self._version_init(strversion, isdev, revision) self._version_userdoc(strversion, isdev, revision) self._version_download(strversion, isdev, revision) self._version_changes(strversion, isdev, revision) parm = {"VERSION": strversion, "REV": revision} for src, dest in self.ebuild_files.items(): src = "%s/%s" % (self.dirs["ebuild"], src) dest = "%s/%s" % (self.dirs["ebuild"], dest % parm) term.green("Creating %(name)s...", name=dest) shell.cp(src, dest)
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') shortversion = tuple(map(int, strversion.split('.')[:2])) shell.rm_rf(self.dirs['_website']) shell.cp_r( self.dirs['userdoc_source'], _os.path.join(self.dirs['_website'], 'src') ) shell.rm_rf(_os.path.join(self.dirs['_website'], 'build')) shell.rm_rf(self.dirs['website']) _os.makedirs(self.dirs['website']) filename = _os.path.join( self.dirs['_website'], 'src', 'website_download.txt' ) fp = textopen(filename) try: download = fp.read() finally: fp.close() filename = _os.path.join(self.dirs['_website'], 'src', 'index.txt') fp = textopen(filename) try: indexlines = fp.readlines() finally: fp.close() fp = textopen(filename, 'w') try: for line in indexlines: if line.startswith('.. placeholder: Download'): line = download fp.write(line) finally: fp.close() shell.cp_r( self.dirs['apidoc'], _os.path.join(self.dirs['website'], 'doc-%d.%d' % shortversion) ) shell.cp_r( self.dirs['apidoc'], _os.path.join( self.dirs['_website'], 'src', 'doc-%d.%d' % shortversion ) ) fp = textopen(_os.path.join( self.dirs['_website'], 'src', 'conf.py' ), 'a') try: fp.write("\nepydoc = dict(wtf=%r)\n" % ( _os.path.join( shell.native(self.dirs['_website']), "src", "doc-%d.%d" % shortversion, ), )) fp.write("\nexclude_trees.append(%r)\n" % "doc-%d.%d" % shortversion ) finally: fp.close() from _setup.dev import userdoc userdoc.sphinx( build=shell.native(_os.path.join(self.dirs['_website'], 'build')), source=shell.native(_os.path.join(self.dirs['_website'], 'src')), target=shell.native(self.dirs['website']), ) shell.rm(_os.path.join(self.dirs['website'], '.buildinfo'))
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read('package.cfg', **cfgread) strversion = parser.get('package', 'version.number') shortversion = tuple(map(int, strversion.split('.')[:2])) shell.rm_rf(self.dirs['_website']) shell.cp_r(self.dirs['userdoc_source'], _os.path.join(self.dirs['_website'], 'src')) shell.rm_rf(_os.path.join(self.dirs['_website'], 'build')) shell.rm_rf(self.dirs['website']) _os.makedirs(self.dirs['website']) filename = _os.path.join(self.dirs['_website'], 'src', 'website_download.txt') fp = textopen(filename) try: download = fp.read() finally: fp.close() filename = _os.path.join(self.dirs['_website'], 'src', 'index.txt') fp = textopen(filename) try: indexlines = fp.readlines() finally: fp.close() fp = textopen(filename, 'w') try: for line in indexlines: if line.startswith('.. placeholder: Download'): line = download fp.write(line) finally: fp.close() shell.cp_r( self.dirs['apidoc'], _os.path.join(self.dirs['website'], 'doc-%d.%d' % shortversion)) shell.cp_r( self.dirs['apidoc'], _os.path.join(self.dirs['_website'], 'src', 'doc-%d.%d' % shortversion)) fp = textopen(_os.path.join(self.dirs['_website'], 'src', 'conf.py'), 'a') try: fp.write("\nepydoc = dict(rcssmin=%r)\n" % (_os.path.join( shell.native(self.dirs['_website']), "src", "doc-%d.%d" % shortversion, ), )) fp.write("\nexclude_trees.append(%r)\n" % "doc-%d.%d" % shortversion) finally: fp.close() from _setup.dev import userdoc userdoc.sphinx( build=shell.native(_os.path.join(self.dirs['_website'], 'build')), source=shell.native(_os.path.join(self.dirs['_website'], 'src')), target=shell.native(self.dirs['website']), ) shell.rm(_os.path.join(self.dirs['website'], '.buildinfo'))
def run(self): from _setup.util import SafeConfigParser as parser parser = parser() parser.read("package.cfg", **cfgread) strversion = parser.get("package", "version.number") shortversion = tuple(map(int, strversion.split(".")[:2])) shell.rm_rf(self.dirs["_website"]) shell.cp_r(self.dirs["userdoc_source"], _os.path.join(self.dirs["_website"], "src")) for filename in shell.files(_os.path.join(self.dirs["_website"], "src"), "*.txt"): fp = textopen(filename, "r") try: content = fp.read().replace("../examples/", "examples/") finally: fp.close() fp = textopen(filename, "w") try: fp.write(content) finally: fp.close() shell.cp_r(self.dirs["examples"], _os.path.join(self.dirs["_website"], "src", "examples")) shell.rm_rf(_os.path.join(self.dirs["_website"], "build")) shell.rm_rf(self.dirs["website"]) _os.makedirs(self.dirs["website"]) filename = _os.path.join(self.dirs["_website"], "src", "website_download.txt") fp = textopen(filename) try: download = fp.read() finally: fp.close() filename = _os.path.join(self.dirs["_website"], "src", "index.txt") fp = textopen(filename) try: indexlines = fp.readlines() finally: fp.close() fp = textopen(filename, "w") try: for line in indexlines: if line.startswith(".. placeholder: Download"): line = download fp.write(line) finally: fp.close() shell.cp_r(self.dirs["examples"], _os.path.join(self.dirs["website"], "examples")) for top, dirs, _ in shell.walk(_os.path.join(self.dirs["website"], "examples")): if ".svn" in dirs: dirs.remove(".svn") shell.rm_rf(_os.path.join(top, ".svn")) if ".git" in dirs: dirs.remove(".git") shell.rm_rf(_os.path.join(top, ".git")) shell.cp_r(self.dirs["apidoc"], _os.path.join(self.dirs["website"], "doc-%d.%d" % shortversion)) shell.cp_r(self.dirs["apidoc"], _os.path.join(self.dirs["_website"], "src", "doc-%d.%d" % shortversion)) fp = textopen(_os.path.join(self.dirs["_website"], "src", "conf.py"), "a") try: fp.write( "\nepydoc = dict(tdi=%r)\n" % (_os.path.join(shell.native(self.dirs["_website"]), "src", "doc-%d.%d" % shortversion),) ) fp.write("\nexclude_trees.append(%r)\n" % "doc-%d.%d" % shortversion) fp.write("\nexclude_trees.append('examples')\n") finally: fp.close() from _setup.dev import userdoc userdoc.sphinx( build=shell.native(_os.path.join(self.dirs["_website"], "build")), source=shell.native(_os.path.join(self.dirs["_website"], "src")), target=shell.native(self.dirs["website"]), ) shell.rm(_os.path.join(self.dirs["website"], ".buildinfo")) fp = open(_os.path.join(self.dirs["website"], "examples", ".htaccess"), "wb") try: fp.write("Options -Indexes\n") fp.write("<Files *.py>\n") fp.write("ForceType text/plain\n") fp.write("</Files>\n") fp.write("<Files *.out>\n") fp.write("ForceType text/plain\n") fp.write("</Files>\n") finally: fp.close()