def updateVersionInfo(mode, dry_run=False): """ Update the __tag__.py module with the new tag and build date. """ prevTag, prevBuildDate = version_info() logger.info('Previous tag was %s...' % prevTag) version, release, patch = [int(item) for item in prevTag.split('.')] if mode == 'major': version += 1 release = 0 patch = 0 elif mode == 'minor': release += 1 patch = 0 elif mode == 'patch': patch += 1 else: abort('Unknown release mode %s.' % mode) nextTag = '%s.%s.%s' % (version, release, patch) logger.info('Writing new tag (%s) to %s...' %\ (nextTag, XIMPOL_VERSION_FILE_PATH)) if not dry_run: outputFile = open(XIMPOL_VERSION_FILE_PATH, 'w') outputFile.writelines('TAG = \'%s\'\n' % nextTag) outputFile.writelines('BUILD_DATE = \'%s\'\n' % BUILD_DATE) outputFile.close() logger.info('Done.') return nextTag
def distsrc(): """ Create a plain source distribution. """ tag, buildDate = version_info() logger.info('Creating plain source distribution...') distDir = os.path.join(XIMPOL_DIST, 'src') srcLogFilePath = 'src.log' # Create the distribution. cmd('python setup.py sdist --dist-dir=%s --prune' % distDir, verbose=False, logFilePath=srcLogFilePath) # Cleanup. rm(srcLogFilePath) rm(os.path.join(XIMPOL_ROOT, 'MANIFEST')) logger.info('Done.')