This will make it possible to reuse the function, and avoid having the version number defined in multiple places. --- Namcap/version.py | 25 +++++++++++++++++++++++++ setup.py | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Namcap/version.py diff --git a/Namcap/version.py b/Namcap/version.py new file mode 100644 index 0000000..9885d35 --- /dev/null +++ b/Namcap/version.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# +# namcap - version +# Copyright (c) 2015 Rikard Falkeborn <rikard.falkeborn@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# + +def get_version(): + return '3.2.5' + +# vim: set ts=4 sw=4 noet: diff --git a/setup.py b/setup.py index e6d3956..369bd3e 100755 --- a/setup.py +++ b/setup.py @@ -1,12 +1,13 @@ #!/usr/bin/env python from setuptools import setup, find_packages +import Namcap.version DATAFILES = [('/usr/share/man/man1', ['namcap.1']), ('/usr/share/namcap', ['namcap-tags', 'parsepkgbuild.sh']), ('/usr/share/doc/namcap',['README','AUTHORS','TODO'])] setup(name="namcap", - version="3.2.5", + version=Namcap.version.get_version(), description="Pacman package analyzer", author="Arch Dev Team", -- 2.4.6