diff --git a/flake8_isort.py b/flake8_isort.py index 4dccdb2..7b83099 100644 --- a/flake8_isort.py +++ b/flake8_isort.py @@ -13,9 +13,12 @@ from ConfigParser import SafeConfigParser +__version__ = '2.8.1.dev0' + + class Flake8Isort(object): name = 'flake8_isort' - version = '2.3' + version = __version__ isort_unsorted = ( 'I001 isort found an import in the wrong position' ) diff --git a/setup.py b/setup.py index b7e90be..69500e8 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,16 @@ # -*- coding: utf-8 -*- from setuptools import setup +import re + + +def get_version(file="flake8_isort.py"): + with open(file) as f: + for line in f: + m = re.match(r"^__version__ = '(?P.*?)'$", line) + if m: + return m.group('version') + short_description = 'flake8 plugin that integrates isort .' @@ -12,7 +22,7 @@ setup( name='flake8-isort', - version='2.8.1.dev0', + version=get_version(), description=short_description, long_description=long_description, # Get more from http://pypi.python.org/pypi?%3Aaction=list_classifiers