From 3fabe017aeca949274b460542faa487622d2ab99 Mon Sep 17 00:00:00 2001 From: Tarek Ziade Date: Tue, 14 Feb 2012 13:18:16 +0100 Subject: [PATCH] display all versions in --version - fixes #7 --- flake8/__init__.py | 3 +++ flake8/pep8.py | 6 +++++- flake8/pyflakes.py | 2 ++ setup.py | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/flake8/__init__.py b/flake8/__init__.py index 792d600..79e5c5b 100644 --- a/flake8/__init__.py +++ b/flake8/__init__.py @@ -1 +1,4 @@ # + +__version__ = '1.1' + diff --git a/flake8/pep8.py b/flake8/pep8.py index 37d5042..a3e93cd 100644 --- a/flake8/pep8.py +++ b/flake8/pep8.py @@ -92,6 +92,8 @@ before the docstring, you can use \n for newline, \t for tab and \s for space. """ +from flake8 import __version__ as flake8_version +from pyflakes import __version__ as pep8_version __version__ = '0.6.1' @@ -1266,7 +1268,9 @@ def process_options(arglist=None): Process options passed either via arglist or via command line args. """ global options, args - parser = OptionParser(version=__version__, + version = '%s (pyflakes: %s, pep8: %s)' % (flake8_version, pep8_version, + __version__) + parser = OptionParser(version=version, usage="%prog [options] input ...") parser.add_option('--max-complexity', default=-1, action='store', type='int', help="McCabe complexity treshold") diff --git a/flake8/pyflakes.py b/flake8/pyflakes.py index 16ec1a4..036b25c 100644 --- a/flake8/pyflakes.py +++ b/flake8/pyflakes.py @@ -10,6 +10,8 @@ import sys from flake8 import messages from flake8.util import skip_warning +__version__ = '0.5.0' + # utility function to iterate over an AST node's children, adapted # from Python 2.6's standard ast module try: diff --git a/setup.py b/setup.py index 3fa1a35..b34ccc0 100755 --- a/setup.py +++ b/setup.py @@ -3,12 +3,14 @@ try: except ImportError: from distutils.core import setup +from flake8 import __version__ + README = open('README').read() setup( name="flake8", license="MIT", - version="1.1", + version=__version__, description="code checking using pep8 and pyflakes", author="Tarek Ziade", author_email="tarek@ziade.org",