From 134da8840bf281929bda63cf285c1a89d5390aaa Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Mon, 18 Mar 2013 12:09:36 +0100 Subject: [PATCH] zest.releaser --- CHANGES.md => CHANGES | 58 +++++++++++++++++----------------------- MANIFEST.in | 2 +- acrylamid/__init__.py | 6 +++-- acrylamid/commands.py | 7 ++--- acrylamid/lib/CHANGES | 1 + acrylamid/lib/CHANGES.md | 1 - acrylamid/lib/history.py | 11 +++++--- docs/conf.py | 17 +++++++----- requirements.txt | 3 +++ setup.py | 5 +--- 10 files changed, 56 insertions(+), 55 deletions(-) rename CHANGES.md => CHANGES (95%) create mode 120000 acrylamid/lib/CHANGES delete mode 120000 acrylamid/lib/CHANGES.md diff --git a/CHANGES.md b/CHANGES similarity index 95% rename from CHANGES.md rename to CHANGES index d2f2bb9b..aca93b08 100644 --- a/CHANGES.md +++ b/CHANGES @@ -1,9 +1,8 @@ -# Acrylamid Changelog +Changelog for Acrylamid +======================= -Version 0.7 ------------ - -Not released – TBD +0.7 (unreleased) +---------------- ### What's new? @@ -17,8 +16,8 @@ Not released – TBD ### What has been fixed? -Version 0.6 ------------ +0.6 (2013-02-12) +---------------- Released on February, 12th, 2013 – Almost stable. @@ -66,8 +65,8 @@ Released on February, 12th, 2013 – Almost stable. - #103 – pass encoded values into `os.environ` to allow fancy unicode characters such as » or Aкриламид. -Version 0.5 ------------ +0.5 (2013-01-20) +---------------- Released on January, 20th 2013 – Winter Is Coming! @@ -121,8 +120,8 @@ Released on January, 20th 2013 – Winter Is Coming! - #77 – missing items in sitemap view - #75 – dotfiles not copied from the static folder (Mark van Lent) -Version 0.4 ------------ +0.4 (2012-09-19) +---------------- Released on September, 19th 2012 – Arrr! @@ -163,8 +162,8 @@ thank @markvl, @moschlar and @t-8ch for their patches and patience to test broken builds. -Version 0.3 ------------ +0.3 (2012-04-11) +---------------- ### 0.3.5 @@ -258,35 +257,26 @@ Released on April, 1th 2012 – Aprilscherz - some unit tests - speed improvements -Version 0.2 ------------ - -### 0.2.2 +0.2 (2011-12-16) +---------------- - add static page support (see docs/howtows.rst) - fix update when entry moved/drafted - -### 0.2.1 - - new draft feature that excludes entries from everything except entry view - minor bugfixes - -### 0.2.0 - -Released on 16th December 2011 - - introduced caching - lazy evaluation for expensive operations - first docs -Version 0.1.11 --------------- - -- Tag-View -- pass-through filter -- removed pyyaml dependency +0.1 (2011-11-16) +---------------- -Version 0.1.10 --------------- +Initial release. -Initial release, released on November 16th 2011 +- german hyphenation support +- summarizing page/items +- reStructuredText and Markdown Markup Support +- RSS and Atom feed generation +- theming support using Jinja2 +- flat file database +- powerful callback API diff --git a/MANIFEST.in b/MANIFEST.in index 3dc18502..2d51c190 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,7 +4,7 @@ recursive-exclude acrylamid *.pyc recursive-include acrylamid/filters/hyph *.txt recursive-include acrylamid/defaults * -include acrylamid/lib/CHANGES.md +include acrylamid/lib/CHANGES include acrylamid/views/search/search.js include acrylamid/specs/samples/blog.posativ.org.xml diff --git a/acrylamid/__init__.py b/acrylamid/__init__.py index 4430f0bd..53785e35 100644 --- a/acrylamid/__init__.py +++ b/acrylamid/__init__.py @@ -16,7 +16,9 @@ # those of the authors and should not be interpreted as representing official # policies, either expressed or implied, of Martin Zimmermann . -__version__ = '0.6.0' +import pkg_resources +dist = pkg_resources.get_distribution("acrylamid") + __author__ = 'Martin Zimmermann ' __url__ = 'https://github.com/posativ/acrylamid/' @@ -79,7 +81,7 @@ def Acryl(): parser.add_argument("--conf", dest="conf", help="alternate conf.py", default="conf.py", metavar="/path/to/conf") parser.add_argument("--version", action="version", - version=colors.blue('Acrylamid ') + __version__) + version=colors.blue('Acrylamid ') + dist.version) subparsers = parser.add_subparsers(dest="parser") diff --git a/acrylamid/commands.py b/acrylamid/commands.py index c8e66053..7b82dc93 100644 --- a/acrylamid/commands.py +++ b/acrylamid/commands.py @@ -15,10 +15,12 @@ from collections import defaultdict from os.path import getmtime +from distutils.version import LooseVersion + from acrylamid import log from acrylamid.errors import AcrylamidException -from acrylamid import readers, filters, views, assets, refs, hooks, helpers, __version__ +from acrylamid import readers, filters, views, assets, refs, hooks, helpers, dist from acrylamid.lib import lazy, history from acrylamid.core import cache, load from acrylamid.utils import hash, istext, HashableList, import_object, total_seconds @@ -34,8 +36,7 @@ def initialize(conf, env): cache.init(conf.get('cache_dir')) env['version'] = type('Version', (str, ), dict(zip( - ['major', 'minor', 'patch'], (int(x) for x in __version__.split('.')) - )))(__version__) + ['major', 'minor'], LooseVersion(dist.version).version[:2])))(dist.version) # crawl through CHANGES.md and stop on breaking changes if history.breaks(env, cache.emptyrun): diff --git a/acrylamid/lib/CHANGES b/acrylamid/lib/CHANGES new file mode 120000 index 00000000..693f810d --- /dev/null +++ b/acrylamid/lib/CHANGES @@ -0,0 +1 @@ +../../CHANGES \ No newline at end of file diff --git a/acrylamid/lib/CHANGES.md b/acrylamid/lib/CHANGES.md deleted file mode 120000 index 8980b4a7..00000000 --- a/acrylamid/lib/CHANGES.md +++ /dev/null @@ -1 +0,0 @@ -../../CHANGES.md \ No newline at end of file diff --git a/acrylamid/lib/history.py b/acrylamid/lib/history.py index 1285ecfe..0e28b2e2 100644 --- a/acrylamid/lib/history.py +++ b/acrylamid/lib/history.py @@ -19,7 +19,7 @@ def changesfor(version): """return CHANGES for `version` and whether it *breaks*.""" - with io.open(join(dirname(PATH), 'CHANGES.md'), encoding='utf-8') as fp: + with io.open(join(dirname(PATH), 'CHANGES'), encoding='utf-8') as fp: rv = [] section, paragraph, safe = False, False, True @@ -29,7 +29,7 @@ def changesfor(version): if not line: continue - m = re.match('^version (\d\.\d)$', line, re.IGNORECASE) + m = re.match(r'^(\d\.\d) \(\d{4}-\d{2}-\d{2}\)$', line) if m: section = m.group(1) == version @@ -62,19 +62,22 @@ def breaks(env, firstrun): if version >= (env.version.major, env.version.minor): return False - memoize('version', (env.version.major, env.version.minor, env.version.patch)) + memoize('version', (env.version.major, env.version.minor)) if firstrun: return False broken = False - print for major in range(version[0], env.version.major or 1): for minor in range(version[1], env.version.minor): rv, hints = changesfor('%i.%i' % (major, minor + 1)) broken = broken or rv + if not hints: + continue + + print print (blue('Acrylamid') + ' %i.%s' % (major, minor+1) + u' – changes').encode('utf-8'), if broken: diff --git a/docs/conf.py b/docs/conf.py index ed0ec222..54a71929 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,11 @@ # -*- coding: utf-8 -*- -import sys, os +import sys +import os +import datetime +import pkg_resources + +from distutils.version import LooseVersion # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -20,10 +25,10 @@ # General information about the project. project = u'Acrylamid' -copyright = u'2013, posativ' +copyright = u'%i, Martin Zimmermann' % datetime.date.today().year -version = '0.6' -release = '0.6.0' +release = pkg_resources.get_distribution("acrylamid").version # 0.6, 0.6.1, 0.7 or 0.7.1 +version = '%i.%i' % tuple(LooseVersion(release).version[:2]) # 0.6 or 0.7 # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -41,7 +46,7 @@ latex_documents = [ ('index', 'acrylamid.tex', u'Acrylamid Documentation', - u'posativ', 'manual'), + u'Martin Zimmermann', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -74,5 +79,5 @@ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'acrylamid', u'Acrylamid Documentation', - [u'posativ'], 1) + [u'Martin Zimmermann'], 1) ] diff --git a/requirements.txt b/requirements.txt index ef5b10a4..7cdc6c07 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,9 @@ Attest-latest==0.6dev-20121124 cram==0.5 +# releasing +zest.releaser + # requirements Jinja2==2.6 Markdown==2.2.1 diff --git a/setup.py b/setup.py index 52e5a562..87744691 100755 --- a/setup.py +++ b/setup.py @@ -6,9 +6,6 @@ from os.path import join, dirname from setuptools import setup, find_packages -version = re.search("__version__ = '([^']+)'", - open('acrylamid/__init__.py').read()).group(1) - requires = ['Jinja2>=2.4', 'Markdown>=2.0.1'] kw = {} @@ -27,7 +24,7 @@ setup( name='acrylamid', - version=version, + version='0.7.dev0', author='Martin Zimmermann', author_email='info@posativ.org', packages=find_packages(),