From 82c2688adeda9286de8819a254c7d0ca1ef0669f Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Wed, 23 Oct 2013 08:06:52 +0200 Subject: python: let's not hardcode version in setups Let's write openlmi version to the main __init__ module of each python egg at build time. This version information is easily accessible from setup scripts. --- src/pcp/lmi/pcp/__init__.py | 3 ++- src/pcp/lmi/pcp/__init__.skel | 26 ++++++++++++++++++++++++++ src/pcp/setup.py | 4 +++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/pcp/lmi/pcp/__init__.skel (limited to 'src/pcp') diff --git a/src/pcp/lmi/pcp/__init__.py b/src/pcp/lmi/pcp/__init__.py index 81de2e5..db421b6 100644 --- a/src/pcp/lmi/pcp/__init__.py +++ b/src/pcp/lmi/pcp/__init__.py @@ -18,8 +18,9 @@ # # Authors: Frank Ch. Eigler # - """ CIM providers for PCP metrics. Part of OpenLMI project. """ + +__version__ = "0.3.0" diff --git a/src/pcp/lmi/pcp/__init__.skel b/src/pcp/lmi/pcp/__init__.skel new file mode 100644 index 0000000..2d5b613 --- /dev/null +++ b/src/pcp/lmi/pcp/__init__.skel @@ -0,0 +1,26 @@ +# PCP bridge Providers +# +# Copyright (C) 2013 Red Hat, Inc. All rights reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Authors: Frank Ch. Eigler +# +""" +CIM providers for PCP metrics. +Part of OpenLMI project. +""" + +__version__ = "@OPENLMI_VERSION@" diff --git a/src/pcp/setup.py b/src/pcp/setup.py index 27a6404..8995892 100644 --- a/src/pcp/setup.py +++ b/src/pcp/setup.py @@ -1,11 +1,13 @@ from setuptools import setup +from lmi.pcp import __version__ + setup( name='openlmi-pcp', description='PCP metric providers', author='Frank Ch. Eigler', author_email='fche@redhat.com', url='https://fedorahosted.org/openlmi/', - version='0.3.0', + version=__version__, namespace_packages=['lmi'], packages=[ 'lmi', -- cgit