From 652f5e73f5ec714b3ec88c24afad8fc0f4f4b33a Mon Sep 17 00:00:00 2001 From: Rob Dennis Date: Fri, 4 Apr 2014 22:29:14 -0400 Subject: issue #20, #46 - refactored version numbers and bumped to 5.0.3 --- README.md | 2 +- _version.py | 1 + configobj.py | 1 + docs/conf.py | 9 ++++----- docs/configobj.rst | 8 ++++++-- setup.py | 13 +++++++++++-- 6 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 _version.py diff --git a/README.md b/README.md index c38bc33..400e82e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Found at [readthedocs](http://configobj.readthedocs.org/) Status ========= -This project has is now maintained by [Eli Courtwright](https://github.com/EliAndrewC) and [Rob Dennis](https://github.com/robdennis) with the blessing of original creator [Michael Foord](http://www.voidspace.org.uk/) and the most recent release is version *5.0.2* (view [changelog](http://configobj.readthedocs.org/en/v5.0.2/configobj.html#version-5-0-2)). +This project has is now maintained by [Eli Courtwright](https://github.com/EliAndrewC) and [Rob Dennis](https://github.com/robdennis) with the blessing of original creator [Michael Foord](http://www.voidspace.org.uk/) and the most recent release is version *5.0.3* (view [changelog](http://configobj.readthedocs.org/en/v5.0.3/configobj.html#version-5-0-3)). For long time ConfigObj users, the biggest change is in the officially supported python versions: - 2.6 diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..245a3aa --- /dev/null +++ b/_version.py @@ -0,0 +1 @@ +__version__ = '5.0.3' \ No newline at end of file diff --git a/configobj.py b/configobj.py index 26b7fd0..8ad7c8f 100644 --- a/configobj.py +++ b/configobj.py @@ -20,6 +20,7 @@ import sys from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, BOM_UTF16_LE import six +from _version import __version__ # imported lazily to avoid startup performance hit if it isn't used compiler = None diff --git a/docs/conf.py b/docs/conf.py index d969dde..b6f83e1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,8 +12,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os +from _version import __version__ # 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 @@ -52,10 +51,10 @@ copyright = u'2014, Michael Foord, Nicola Larosa, Rob Dennis, Eli Courtwright' # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = '5.0' # The full version, including alpha/beta/rc tags. -release = '5.0.2' +release = __version__ +# The short X.Y version. +version = '.'.join(release.split('.')[:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/configobj.rst b/docs/configobj.rst index e6bf5de..763fee2 100644 --- a/docs/configobj.rst +++ b/docs/configobj.rst @@ -8,7 +8,7 @@ ---------------------------------------- :Authors: Michael Foord, Nicola Larosa, Rob Dennis, Eli Courtwright -:Version: ConfigObj 5.0.2 +:Version: ConfigObj 5.0.3 :Date: 2014/02/08 :PyPI Entry: `ConfigObj on PyPI `_ :Homepage: `Github Page`_ @@ -64,7 +64,7 @@ For support and bug reports please use the ConfigObj `Github Page`_. Downloading =========== -The current version is **5.0.2**, dated 19th February 2014. ConfigObj 5 is +The current version is **5.0.3**, dated 4th April 2014. ConfigObj 5 is stable and mature. We still expect to pick up a few bugs along the way though, particularly with respect to Python 3 compatibility [#]_. We recommend downloading and installing using pip: @@ -2383,6 +2383,10 @@ CHANGELOG This is an abbreviated changelog showing the major releases up to version 4. From version 4 it lists all releases and changes. +2014/04/04 - Version 5.0.3 +-------------------------- +* BUGFIX: not handling unicode encoding well, especially with respect to writing out files + 2014/02/27 - Version 5.0.2 -------------------------- * Specific error message for installing version this version on Python versions older than 2.5 diff --git a/setup.py b/setup.py index cc423ab..0e0babd 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ # This software is licensed under the terms of the BSD license. # http://opensource.org/licenses/BSD-3-Clause +import os import sys from distutils.core import setup @@ -18,8 +19,14 @@ if sys.version_info < (2, 6): 'version 4.7.2') sys.exit(1) -# TODO - #20 - refactor the way we do versions -VERSION = '5.0.2' +__here__ = os.path.abspath(os.path.dirname(__file__)) + +# http://stackoverflow.com/a/16084844/171094 +with open(os.path.join(__here__, '_version.py')) as version: + exec(version.read()) +# __version__ is now defined + +VERSION = __version__ NAME = 'configobj' MODULES = 'configobj', 'validate' @@ -47,6 +54,8 @@ It has lots of other features though : * The order of keys/sections is preserved * Powerful ``unrepr`` mode for storing/retrieving Python data-types +| Release 5.0.3 corrects errors related to the incorrectly handling unicode +| encoding and writing out files | Release 5.0.2 adds a specific error message when trying to install on | Python versions older than 2.5 | Release 5.0.1 fixes a regression with unicode conversion not happening -- cgit v1.2.1 From 54a2572fb9d6c9b1f63585938ad246ddada49982 Mon Sep 17 00:00:00 2001 From: Rob Dennis Date: Fri, 4 Apr 2014 22:58:28 -0400 Subject: issue #20 - needed to add _version to modules, and made __version__ a simple import since we're not use a package --- setup.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 0e0babd..6825606 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,8 @@ import os import sys from distutils.core import setup +# a simple import wouldn't work if we moved towards a package with __init__ +from _version import __version__ if sys.version_info < (2, 6): print('for python versions < 2.6 use configobj ' @@ -21,14 +23,9 @@ if sys.version_info < (2, 6): __here__ = os.path.abspath(os.path.dirname(__file__)) -# http://stackoverflow.com/a/16084844/171094 -with open(os.path.join(__here__, '_version.py')) as version: - exec(version.read()) -# __version__ is now defined - VERSION = __version__ NAME = 'configobj' -MODULES = 'configobj', 'validate' +MODULES = 'configobj', 'validate', '_version' DESCRIPTION = 'Config file reading, writing and validation.' -- cgit v1.2.1