diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-29 18:49:35 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-29 18:59:03 -0700 |
commit | 2c30aa6572b9c8e455fb0aba5b5ed75361962d6b (patch) | |
tree | 859d2774d7570e76c1b5df1596e7a169fb0081fd | |
parent | a335010cbe43a661a36437e7653ce5620dd01350 (diff) | |
download | attobuild-2c30aa6572b9c8e455fb0aba5b5ed75361962d6b.tar.gz attobuild-2c30aa6572b9c8e455fb0aba5b5ed75361962d6b.tar.bz2 attobuild-2c30aa6572b9c8e455fb0aba5b5ed75361962d6b.tar.xz attobuild-2c30aa6572b9c8e455fb0aba5b5ed75361962d6b.zip |
Improve version messages
-rw-r--r-- | attoconf/_version.py | 2 | ||||
-rw-r--r-- | attoconf/version.py | 38 |
2 files changed, 33 insertions, 7 deletions
diff --git a/attoconf/_version.py b/attoconf/_version.py index 001d223..5e27224 100644 --- a/attoconf/_version.py +++ b/attoconf/_version.py @@ -11,7 +11,7 @@ minor = 8 # Incremented if there is a bugfix release. # Might not be contiguous. -patch = 3 +patch = 4 # Reserved for distributors and forks. # Contains arbitrary text, but no parentheses or newlines. diff --git a/attoconf/version.py b/attoconf/version.py index 3194aec..829005c 100644 --- a/attoconf/version.py +++ b/attoconf/version.py @@ -22,19 +22,45 @@ import sys from . import _version if sys.version_info[0] != 2 or sys.version_info[1] < 7: - sys.exit('Unsupported Python version: %s\nRequire Python 2.7' % sys.version) + sys.exit('Unsupported Python version: %s\nattoconf requires Python 2.7' % sys.version) def require_version(major, minor, patch=0): ''' Check that this is the right version of attoconf, or die trying. ''' - - actual = 'Current version: ' + full_version if major != _version.major: - sys.exit('Unsupported major version: %d\n' % major + actual) + # Once I release attoconf 1.0, I *probably* won't ever + # do another major upgrade - that would be difficult to package. + sys.exit( +''' +This configure script requires a different major version of attoconf. +Major version changes are rare, and software written against the one +version is likely to need changes to work with the other version. + +Current version: %s +Minimum required version: %d.%d.%d +''' % (full_version, major, minor, patch)) if minor > _version.minor: - sys.exit('Unsupported minor version: %d.%d\n' % (major, minor) + actual) + # In the interest of good style, it sometimes *should* be rewritten. + sys.exit( +''' +This configure script requires a newer minor version of attoconf. +Minor version changes are common, and software written against the one +minor version will work with all later minor versions. + +Current version: %s +Minimum required version: %d.%d.%d +''' % (full_version, major, minor, patch)) if minor == _version.minor and patch > _version.patch: - sys.exit('Unsupported patch version: %d.%d.%d\n' % (major, minor, patch) + actual) + sys.exit( +''' +This configure script requires a newer patch version of attoconf. +Patch versions are usually not released unless there is a bug in a minor +version, but it is possible that someone is using experimental features. +If there is one, upgrade to the latest minor version instead. + +Current version: %s +Minimum required version: %d.%d.%d +''' % (full_version, major, minor, patch)) part_version = '%d.%d.%d' % (_version.major, _version.minor, _version.patch) full_version = 'attoconf %s (%s)' % (part_version, _version.distributor) |