[Checkins] SVN: keas.build/trunk/ Add a bit more error handling; make building a big package a bit faster; add a bit more info level logging around package creation and upload.
Paul Carduner
paulcarduner at gmail.com
Wed Sep 30 19:51:52 EDT 2009
Log message for revision 104663:
Add a bit more error handling; make building a big package a bit faster; add a bit more info level logging around package creation and upload.
Changed:
U keas.build/trunk/CHANGES.txt
U keas.build/trunk/src/keas/build/install.py
U keas.build/trunk/src/keas/build/package.py
-=-
Modified: keas.build/trunk/CHANGES.txt
===================================================================
--- keas.build/trunk/CHANGES.txt 2009-09-30 22:52:21 UTC (rev 104662)
+++ keas.build/trunk/CHANGES.txt 2009-09-30 23:51:51 UTC (rev 104663)
@@ -4,8 +4,15 @@
0.1.4 (unreleased)
------------------
-- ...
+- Bug Fix: installer script would crash when -u option was missing a
+ trailing /
+- Bug Fix: installer script would crash when no variants were found.
+
+- Improvement: Building a package will no longer checkout the entire
+ branch just to update the setup.py file with the new version
+ number. Instead only the top level directory is checked out.
+
0.1.3 (2009-09-30)
------------------
Modified: keas.build/trunk/src/keas/build/install.py
===================================================================
--- keas.build/trunk/src/keas/build/install.py 2009-09-30 22:52:21 UTC (rev 104662)
+++ keas.build/trunk/src/keas/build/install.py 2009-09-30 23:51:51 UTC (rev 104663)
@@ -52,6 +52,8 @@
def getVariants(self, project):
logger.debug('Package Index: ' + self.options.url)
+ if not self.options.url.endswith('/'):
+ self.options.url += '/'
req = urllib2.Request(self.options.url + project)
if self.options.username:
@@ -115,6 +117,9 @@
print 'Variants'
for name in variants:
print ' * ' + name
+ if not variants:
+ logger.error("No variants found, this script only works with variants.")
+ sys.exit(0)
variant = base.getInput('Variant', variants[0], False)
# 3. Get the version of the project.
version = self.options.version
Modified: keas.build/trunk/src/keas/build/package.py
===================================================================
--- keas.build/trunk/src/keas/build/package.py 2009-09-30 22:52:21 UTC (rev 104662)
+++ keas.build/trunk/src/keas/build/package.py 2009-09-30 23:51:51 UTC (rev 104663)
@@ -203,6 +203,7 @@
branchUrl = self.getBranchURL(branch)
tagUrl = self.getTagURL(version)
+ logger.info('Creating release tag')
#TODO: destination folder might not exist... create it
base.do('svn cp -m "Create release tag" %s %s' %(branchUrl, tagUrl))
@@ -213,6 +214,7 @@
# 3. Create release
# 3.1. Remove setup.cfg
+ logger.info("Updating tag version metadata")
setupCfgPath = os.path.join(tagDir, 'setup.cfg')
if os.path.exists(setupCfgPath):
os.remove(setupCfgPath)
@@ -227,6 +229,7 @@
# 4. Upload the distribution
if self.uploadType == 'internal':
# 3.4. Create distribution
+ logger.info("Creating release tarball")
base.do('python setup.py sdist', cwd = tagDir)
if is_win32:
@@ -236,6 +239,7 @@
distributionFileName = os.path.join(
tagDir, 'dist', '%s-%s.%s' %(self.pkg, version, ext))
if not self.options.noUpload:
+ logger.info("Uploading release.")
base.uploadFile(
distributionFileName,
self.packageIndexUrl,
@@ -243,15 +247,17 @@
self.options.offline)
elif self.uploadType == 'setup.py':
# 3.4. Create distribution and upload in one step
+ logger.info("Uploading release to PyPI.")
base.do('python setup.py sdist register upload', cwd = tagDir)
else:
logger.warn('Unknown uploadType: ' + self.uploadType)
# 5. Update the start branch to the next devel version
if not self.options.noBranchUpdate:
+ logger.info("Updating branch version metadata")
# 5.1. Check out the branch.
branchDir = os.path.join(buildDir, 'branch')
- base.do('svn co %s %s' %(branchUrl, branchDir))
+ base.do('svn co --non-recursive %s %s' %(branchUrl, branchDir))
# 5.2. Get the current version.
setuppy = file(os.path.join(branchDir, 'setup.py'), 'r').read()
currVersion = re.search("version ?= ?'(.*)',", setuppy)
More information about the checkins
mailing list