diff --git a/Makefile b/Makefile index 2fb7802..3585231 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,9 @@ publish: clean python setup.py sdist upload python setup.py bdist_egg upload python setup.py bdist_wininst upload + +test_version: + PYTHONPATH=. python -m scour.scour --version + +test_help: + PYTHONPATH=. python -m scour.scour --help diff --git a/scour/__init__.py b/scour/__init__.py index 1282886..7a305fc 100644 --- a/scour/__init__.py +++ b/scour/__init__.py @@ -1,6 +1,6 @@ ############################################################################### ## -## Copyright (C) 2013 Tavendo GmbH +## Copyright (C) 2010 Jeff Schiller, 2010 Louis Simard, 2013-2015 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. @@ -15,3 +15,5 @@ ## limitations under the License. ## ############################################################################### + +__version__ = u'0.31' diff --git a/scour/scour.py b/scour/scour.py index 5747483..978d45d 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -76,9 +76,11 @@ try: except ImportError: pass -APP = 'scour' -VER = '0.30' -COPYRIGHT = 'Copyright Jeff Schiller, Louis Simard, 2010' +from scour import __version__ + +APP = u'scour' +VER = __version__ +COPYRIGHT = u'Copyright Jeff Schiller, Louis Simard, 2010' NS = {'SVG': 'http://www.w3.org/2000/svg', 'XLINK': 'http://www.w3.org/1999/xlink', diff --git a/setup.py b/setup.py index 1ced1ee..cb38584 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ ## ############################################################################### +import re from setuptools import setup, find_packages LONGDESC = """ @@ -30,9 +31,19 @@ Authors: - Tobias Oberstein (maintainer) """ +VERSIONFILE = "scour/__init__.py" +verstrline = open(VERSIONFILE, "rt").read() +VSRE = r"^__version__ = u['\"]([^'\"]*)['\"]" +mo = re.search(VSRE, verstrline, re.M) +if mo: + verstr = mo.group(1) +else: + raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) + + setup ( name = 'scour', - version = '0.30', + version = verstr, description = 'Scour SVG Optimizer', # long_description = open("README.md").read(), long_description = LONGDESC,