[Checkins] SVN: bluebream/trunk/ Merged the ccomb-remove-bbkit branch:
Christophe Combelles
ccomb at free.fr
Sat Jul 10 06:47:12 EDT 2010
Log message for revision 114496:
Merged the ccomb-remove-bbkit branch:
merged bbkit into bluebream, depend on the ZTK, allow to choose bluebream
version during project creation, upgraded the bootstrap, detect the latest
version online, updated the tests and docs
Changed:
U bluebream/trunk/CHANGES.txt
A bluebream/trunk/HOWTO_RELEASE.txt
U bluebream/trunk/README.txt
U bluebream/trunk/bootstrap.py
U bluebream/trunk/buildout.cfg
A bluebream/trunk/scripts/
U bluebream/trunk/src/bluebream/bluebream_base/project_template/bootstrap.py
U bluebream/trunk/src/bluebream/bluebream_base/project_template/buildout.cfg_tmpl
D bluebream/trunk/src/bluebream/bluebream_base/project_template/versions.cfg
U bluebream/trunk/src/bluebream/bluebream_base/template.py
U bluebream/trunk/src/bluebream/bluebream_base/tests/bluebream.txt
A bluebream/trunk/versions.cfg
-=-
Modified: bluebream/trunk/CHANGES.txt
===================================================================
--- bluebream/trunk/CHANGES.txt 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/CHANGES.txt 2010-07-10 10:47:12 UTC (rev 114496)
@@ -4,7 +4,10 @@
1.0b3 (unreleased)
------------------
-- Nothing changed yet.
+- Directly depend on the ZTK!
+- Removed the bbkit package
+- Ask the version of BlueBream at project creation
+- Automatically find and suggest the latest version online
1.0b2 (2010-06-30)
Copied: bluebream/trunk/HOWTO_RELEASE.txt (from rev 114495, bluebream/branches/ccomb-remove-bbkit/HOWTO_RELEASE.txt)
===================================================================
--- bluebream/trunk/HOWTO_RELEASE.txt (rev 0)
+++ bluebream/trunk/HOWTO_RELEASE.txt 2010-07-10 10:47:12 UTC (rev 114496)
@@ -0,0 +1,36 @@
+Releasing a new version of BlueBream
+====================================
+
+First run the buildout in an isolated virtualenv::
+
+ $ virtualenv --distribute --no-site-packages sandbox
+ $ ./sandbox/bin/python bootstrap.py
+ $ ./bin/buildout
+
+
+Then update the version of packages in `versions.cfg`.
+You should probably extend the latest version of the ZTK
+You can discover new package versions by running::
+
+ $ ./bin/checkversions buildout.cfg # (use the -l option if needed))
+
+Run the compatibility tests for the additional BlueBream packages::
+
+ $ ./bin/buildout
+ $ ./bin/test
+
+If all tests pass, release a new version using the included `zest.releaser`,
+or manually with the following steps:
+
+- set the correct version number in `setup.py`
+- update the `CHANGELOG.txt`
+- commit and create a tag for this new version
+- change `setup.py` and the `CHANGELOG.txt` to point to the next dev version
+
+- create a clean checkout of the tag in a new directory and run::
+
+ $ python setup.py register sdist upload
+
+- upload `versions.cfg` with the correct name to http://download.zope.org/bluebream/
+
+
Modified: bluebream/trunk/README.txt
===================================================================
--- bluebream/trunk/README.txt 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/README.txt 2010-07-10 10:47:12 UTC (rev 114496)
@@ -119,8 +119,10 @@
- ``interpreter`` -- Name of the custom Python interpreter
-- ``version`` -- Version (like 0.1)
+- ``bluebream`` -- The version of BlueBream
+- ``version`` -- The version of your project
+
- ``description`` -- One-line description of the package
- ``long_description`` -- Multi-line description (in reStructuredText)
@@ -135,9 +137,6 @@
- ``license_name`` -- License name
-- ``zip_safe`` -- ``True``, if the package can be distributed as a .zip
- file otherwise ``False``.
-
If you are in a hurry, you can simply press *Enter/Return* key and
change the values later. But it would be a good idea, if you provide
a good name for your project.
Modified: bluebream/trunk/bootstrap.py
===================================================================
--- bluebream/trunk/bootstrap.py 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/bootstrap.py 2010-07-10 10:47:12 UTC (rev 114496)
@@ -16,8 +16,6 @@
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
-
-$Id: bootstrap.py 105417 2009-11-01 15:15:20Z tarek $
"""
import os, shutil, sys, tempfile, urllib2
@@ -56,11 +54,10 @@
USE_DISTRIBUTE = options.distribute
args = args + ['bootstrap']
-to_reload = False
try:
import pkg_resources
+ import setuptools
if not hasattr(pkg_resources, '_distribute'):
- to_reload = True
raise ImportError
except ImportError:
ez = {}
@@ -73,10 +70,8 @@
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
- if to_reload:
- reload(pkg_resources)
- else:
- import pkg_resources
+ reload(sys.modules['pkg_resources'])
+ import pkg_resources
if sys.platform == 'win32':
def quote(c):
Modified: bluebream/trunk/buildout.cfg
===================================================================
--- bluebream/trunk/buildout.cfg 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/buildout.cfg 2010-07-10 10:47:12 UTC (rev 114496)
@@ -1,34 +1,63 @@
[buildout]
+extensions = mr.developer
develop = .
parts = bluebream
test
- releaser
+ tools
+
+extends = versions.cfg
+
versions = versions
allow-picked-versions = false
-[releaser]
-recipe = zc.recipe.egg
-eggs = zest.releaser
+[versions]
+# additional versions for the toolchain
+zest.releaser = 3.10
+PrettyTable = 0.5
+
+
[bluebream]
recipe = zc.recipe.egg
-eggs = bluebream
+eggs = bluebream [test]
PasteScript
+
[test]
-recipe = zc.recipe.testrunner
-eggs = bluebream[test]
+# run test of additional packages used by bluebream
+recipe = z3c.recipe.compattest
+include = ${bbkit:packages}
-[versions]
-zope.testing = 3.8.6
-zc.buildout = 1.4.3
-distribute = 0.6.13
-zc.recipe.egg = 1.2.2
-zc.recipe.testrunner = 1.2.0
-zope.interface = 3.6.1
-zope.exceptions = 3.6.0
-PasteScript = 1.7.3
-PasteDeploy = 1.3.3
-Paste = 1.7.3.1
-zest.releaser = 3.10
+[tools]
+# tools to check new versions and to release bluebream
+recipe = zc.recipe.egg
+eggs = PrettyTable
+ z3c.checkversions [buildout]
+ zest.releaser
+
+interpreter = py
+
+
+[bbkit]
+# additional packages on top of the ZTK
+version = 1.0dev
+
+packages =
+ bluebream
+ zope.app.xmlrpcintrospection
+ z3c.testsetup
+ zc.table
+# zc.queue
+
+
+[sources]
+# sources for the additional packages
+
+bluebream = svn svn+ssh://svn.zope.org/repos/main/bluebream/trunk
+zope.app.xmlrpcintrospection = svn svn+ssh://svn.zope.org/repos/main/zope.app.xmlrpcintrospection/trunk
+z3c.testsetup = svn svn+ssh://svn.zope.org/repos/main/z3c.testsetup/trunk
+martian = svn svn+ssh://svn.zope.org/repos/main/martian/trunk
+#lovely.remotetask = svn svn+ssh://svn.zope.org/repos/main/lovely.remotetask/trunk
+zc.table = svn svn+ssh://svn.zope.org/repos/main/zc.table/trunk
+#zc.queue = svn svn+ssh://svn.zope.org/repos/main/zc.queue/trunk
Modified: bluebream/trunk/src/bluebream/bluebream_base/project_template/bootstrap.py
===================================================================
--- bluebream/trunk/src/bluebream/bluebream_base/project_template/bootstrap.py 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/src/bluebream/bluebream_base/project_template/bootstrap.py 2010-07-10 10:47:12 UTC (rev 114496)
@@ -16,8 +16,6 @@
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
-
-$Id: bootstrap.py 105417 2009-11-01 15:15:20Z tarek $
"""
import os, shutil, sys, tempfile, urllib2
@@ -56,11 +54,10 @@
USE_DISTRIBUTE = options.distribute
args = args + ['bootstrap']
-to_reload = False
try:
import pkg_resources
+ import setuptools
if not hasattr(pkg_resources, '_distribute'):
- to_reload = True
raise ImportError
except ImportError:
ez = {}
@@ -73,10 +70,8 @@
).read() in ez
ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
- if to_reload:
- reload(pkg_resources)
- else:
- import pkg_resources
+ reload(sys.modules['pkg_resources'])
+ import pkg_resources
if sys.platform == 'win32':
def quote(c):
Modified: bluebream/trunk/src/bluebream/bluebream_base/project_template/buildout.cfg_tmpl
===================================================================
--- bluebream/trunk/src/bluebream/bluebream_base/project_template/buildout.cfg_tmpl 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/src/bluebream/bluebream_base/project_template/buildout.cfg_tmpl 2010-07-10 10:47:12 UTC (rev 114496)
@@ -1,8 +1,8 @@
[buildout]
develop = .
-extends = versions.cfg
+extends = http://download.zope.org/bluebream/bluebream-${bluebream}.cfg
parts = app
- test
+ test
[app]
recipe = zc.recipe.egg
Deleted: bluebream/trunk/src/bluebream/bluebream_base/project_template/versions.cfg
===================================================================
--- bluebream/trunk/src/bluebream/bluebream_base/project_template/versions.cfg 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/src/bluebream/bluebream_base/project_template/versions.cfg 2010-07-10 10:47:12 UTC (rev 114496)
@@ -1,8 +0,0 @@
-[buildout]
-extends = http://download.zope.org/bluebream/bluebream-1.0b2.cfg
-#versions = versions
-
-[versions]
-# Pin-down versions of other dependencies here. Eg:-
-# z3c.form = 2.3.2
-# z3c.formui = 2.2.0
Modified: bluebream/trunk/src/bluebream/bluebream_base/template.py
===================================================================
--- bluebream/trunk/src/bluebream/bluebream_base/template.py 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/src/bluebream/bluebream_base/template.py 2010-07-10 10:47:12 UTC (rev 114496)
@@ -11,12 +11,33 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import re, os, sys, shutil
-import pkg_resources
+from HTMLParser import HTMLParser
from paste.script import templates
from paste.script.templates import var
+from urllib2 import urlopen
+import pkg_resources
+import re, os, sys
+DOWNLOAD_URL = 'http://download.zope.org/bluebream/'
+class FindLatest(HTMLParser):
+ """html parser used to find the latest version file on download.zope.org
+ """
+ def reset(self):
+ """initialize a regexp and a version set"""
+ HTMLParser.reset(self)
+ self.regexp = re.compile('.*bluebream-(.*).cfg$')
+ self.versions = set()
+
+ def handle_starttag(self, tag, attrs):
+ """extract the version from each link"""
+ if tag != 'a':
+ return
+ for attr in attrs:
+ if attr[0] == 'href' and self.regexp.match(attr[1]):
+ self.versions.add(self.regexp.sub('\\1', attr[1]))
+
+
class BlueBream(templates.Template):
_template_dir = 'project_template'
@@ -24,28 +45,46 @@
vars = [
var('python_package',
- 'Main Python package (with namespace, if any)'),
+ u'Main Python package (with namespace, if any)'),
var('interpreter',
- 'Name of custom Python interpreter',
+ u'Name of custom Python interpreter',
default='breampy'),
- var('version', 'Version (like 0.1)', default='0.1'),
- var('description', 'One-line description of the package'),
- var('long_description', 'Multi-line description (in reST)'),
- var('keywords', 'Space-separated keywords/tags'),
- var('author', 'Author name'),
- var('author_email', 'Author email'),
- var('url', 'URL of homepage'),
- var('license_name', 'License name'),
- var('zip_safe',
- 'True/False: if the package can be distributed as a .zip file',
- default=False),
+ var('bluebream', (u'Which version of BlueBream?\n'
+ u'Check on %s' % DOWNLOAD_URL)),
+ var('version', u'Version of your project', default='0.1'),
+ var('description', u'One-line description of the package'),
+ var('long_description', u'Multi-line description (in reST)'),
+ var('keywords', u'Space-separated keywords/tags'),
+ var('author', u'Author name'),
+ var('author_email', u'Author email'),
+ var('url', u'URL of homepage'),
+ var('license_name', u'License name'),
]
def check_vars(self, vars, cmd):
"""This method checks the variables and ask for missing ones
"""
+ # Find the latest versions.cfg online
+ latest = pkg_resources.get_distribution('bluebream').version
+ try:
+ if 'offline' not in vars: #offline is used in tests
+ print 'Searching the latest version...'
+ # parse the download html page and store versions
+ parser = FindLatest()
+ parser.feed(urlopen(DOWNLOAD_URL).read())
+ # return the highest version
+ latest = sorted(parser.versions,
+ key=lambda v: pkg_resources.parse_version(v))[-1]
+ print 'Latest version found: %s' % latest
+ except IOError:
+ # if something wrong occurs, we keep the current version
+ print u'Error while getting the latest version online'
+ print u'Please check that you can access %s' % DOWNLOAD_URL
+
# suggest what Paste chose
for var in self.vars:
+ if var.name == 'bluebream':
+ var.default = latest
if var.name == 'python_package':
var.default = vars['package']
# but keep the user's input if there are dots in the middle
@@ -63,9 +102,10 @@
if vars['package'] in ('bluebream', 'bream', 'zope'):
print
print "Error: The chosen project name results in an invalid " \
- "package name: %s." % name
+ "package name: %s." % vars['package']
print "Please choose a different project name."
sys.exit(1)
+ vars['zip_safe'] = False
return vars
def pre(self, command, output_dir, vars):
Modified: bluebream/trunk/src/bluebream/bluebream_base/tests/bluebream.txt
===================================================================
--- bluebream/trunk/src/bluebream/bluebream_base/tests/bluebream.txt 2010-07-10 10:43:53 UTC (rev 114495)
+++ bluebream/trunk/src/bluebream/bluebream_base/tests/bluebream.txt 2010-07-10 10:47:12 UTC (rev 114496)
@@ -24,6 +24,7 @@
>>> extra_args = [
... "python_package=sample",
... "interpreter=testpy",
+... "bluebream=1.0",
... "version=0.1",
... "description=test_description",
... "long_description=test_long_description",
@@ -32,7 +33,7 @@
... "author_email=test_author_email",
... "url=http://example.com",
... "license_name=Test Public License",
-... "zip_safe=False",
+... "offline=1",
... ]
>>> exit_code = runner.run(option_args + ['-t', 'bluebream', project] + extra_args)
Selected and implied templates:
@@ -41,18 +42,19 @@
Variables:
author: test_author
author_email: test_author_email
+ bluebream: 1.0
description: test_description
egg: sample
interpreter: testpy
keywords: test_keyword
license_name: Test Public License
long_description: test_long_description
+ offline: 1
package: sample
project: sample
python_package: sample
url: http://example.com
version: 0.1
- zip_safe: False
Creating template bluebream
Creating directory ./sample
<BLANKLINE>
@@ -66,7 +68,6 @@
sample/debug.ini
sample/deploy.ini
sample/setup.py
-sample/versions.cfg
sample/etc/site.zcml
sample/etc/zope-debug.conf
sample/etc/zope.conf
@@ -108,18 +109,19 @@
Variables:
author: test_author
author_email: test_author_email
+ bluebream: 1.0
description: test_description
egg: sample.main
interpreter: testpy
keywords: test_keyword
license_name: Test Public License
long_description: test_long_description
+ offline: 1
package: samplemain
project: sample.main
python_package: sample.main
url: http://example.com
version: 0.1
- zip_safe: False
Creating template bluebream
Creating directory ./sample.main
<BLANKLINE>
@@ -132,7 +134,6 @@
sample.main/debug.ini
sample.main/deploy.ini
sample.main/setup.py
-sample.main/versions.cfg
sample.main/etc/site.zcml
sample.main/etc/zope-debug.conf
sample.main/etc/zope.conf
@@ -180,18 +181,19 @@
Variables:
author: test_author
author_email: test_author_email
+ bluebream: 1.0
description: test_description
egg: sample.app.main
interpreter: testpy
keywords: test_keyword
license_name: Test Public License
long_description: test_long_description
+ offline: 1
package: sampleappmain
project: sample.app.main
python_package: sample.app.main
url: http://example.com
version: 0.1
- zip_safe: False
Creating template bluebream
Creating directory ./sample.app.main
<BLANKLINE>
@@ -204,7 +206,6 @@
sample.app.main/debug.ini
sample.app.main/deploy.ini
sample.app.main/setup.py
-sample.app.main/versions.cfg
sample.app.main/etc/site.zcml
sample.app.main/etc/zope-debug.conf
sample.app.main/etc/zope.conf
@@ -252,18 +253,19 @@
Variables:
author: test_author
author_email: test_author_email
+ bluebream: 1.0
description: test_description
egg: foobar.foobar
interpreter: testpy
keywords: test_keyword
license_name: Test Public License
long_description: test_long_description
+ offline: 1
package: foobarfoobar
project: foobar.foobar
python_package: foobar.foobar
url: http://example.com
version: 0.1
- zip_safe: False
Creating template bluebream
Creating directory ./foobar.foobar
<BLANKLINE>
@@ -276,7 +278,6 @@
foobar.foobar/debug.ini
foobar.foobar/deploy.ini
foobar.foobar/setup.py
-foobar.foobar/versions.cfg
foobar.foobar/etc/site.zcml
foobar.foobar/etc/zope-debug.conf
foobar.foobar/etc/zope.conf
@@ -321,18 +322,19 @@
Variables:
author: test_author
author_email: test_author_email
+ bluebream: 1.0
description: test_description
egg: sampleproject
interpreter: testpy
keywords: test_keyword
license_name: Test Public License
long_description: test_long_description
+ offline: 1
package: sampleproject
project: sampleproject
python_package: sample.main
url: http://example.com
version: 0.1
- zip_safe: False
Creating template bluebream
Creating directory ./sampleproject
<BLANKLINE>
@@ -345,7 +347,6 @@
sampleproject/debug.ini
sampleproject/deploy.ini
sampleproject/setup.py
-sampleproject/versions.cfg
sampleproject/etc/site.zcml
sampleproject/etc/zope-debug.conf
sampleproject/etc/zope.conf
Copied: bluebream/trunk/versions.cfg (from rev 114495, bluebream/branches/ccomb-remove-bbkit/versions.cfg)
===================================================================
--- bluebream/trunk/versions.cfg (rev 0)
+++ bluebream/trunk/versions.cfg 2010-07-10 10:47:12 UTC (rev 114496)
@@ -0,0 +1,22 @@
+# main version file for BlueBream
+
+[buildout]
+extends = http://download.zope.org/zopetoolkit/index/1.0a2/ztk-versions.cfg
+ http://download.zope.org/zopetoolkit/index/1.0a2/zopeapp-versions.cfg
+
+
+[versions]
+# Pin-down versions of other dependencies here. Eg:-
+# z3c.form = 2.3.2
+# z3c.formui = 2.2.0
+elementtree = 1.2.6-20050316
+zope.app.xmlrpcintrospection = 3.5.1
+z3c.testsetup = 0.6.1
+zc.table = 0.8.0
+#zc.queue = 1.1
+#lovely.remotetask = 0.5
+
+# Dependencies:
+ClientForm = 0.2.10
+martian = 0.12
+
More information about the checkins
mailing list