diff options
author | 2013-06-06 08:57:41 -0700 | |
---|---|---|
committer | 2015-02-26 15:31:08 -0800 | |
commit | 8ff2ab743613f6497fa2e4b9f703a3550c464d36 (patch) | |
tree | f001b087806ee44cf2f2bab68a5f1e8168ed70e6 /setup.py | |
parent | Fix remaining missing clst_target_path trailing slash issues (diff) | |
download | catalyst-8ff2ab743613f6497fa2e4b9f703a3550c464d36.tar.gz catalyst-8ff2ab743613f6497fa2e4b9f703a3550c464d36.tar.bz2 catalyst-8ff2ab743613f6497fa2e4b9f703a3550c464d36.zip |
Add set_version command to setup.py.
* Add/modify functions to save and retrieve the set version
information or the live git version.
* Change indent to tabs.
Diffstat (limited to 'setup.py')
-rwxr-xr-x[-rw-r--r--] | setup.py | 34 |
1 files changed, 32 insertions, 2 deletions
@@ -1,11 +1,14 @@ -"Catalyst is the release building tool used by Gentoo Linux" +"""Catalyst is a release building tool used by Gentoo Linux""" + import codecs as _codecs -from distutils.core import setup as _setup +from distutils.core import setup as _setup, Command as _Command from email.utils import parseaddr as _parseaddr import os as _os from catalyst import __version__, __maintainer__ +from catalyst.version import set_release_version as _set_release_version +from catalyst.version import get_version as _get_version _this_dir = _os.path.dirname(__file__) @@ -49,6 +52,30 @@ _data_files.extend(_files('livecd', 'lib/catalyst/')) _data_files.extend(_files('targets', 'lib/catalyst/')) +class set_version(_Command): + '''Saves the specified release version information + ''' + global __version__ + description = "hardcode script's version using VERSION from environment" + user_options = [] # [(long_name, short_name, desc),] + + def initialize_options (self): + pass + + def finalize_options (self): + pass + + def run(self): + try: + version = _os.environ['VERSION'] + except KeyError: + print("Try setting 'VERSION=x.y.z' on the command line... Aborting") + return + _set_release_version(version) + __version__ = _get_version() + print("Version set to:\n", __version__) + + _setup( name=_package_name, version=__version__, @@ -82,4 +109,7 @@ _setup( ], data_files=_data_files, provides=[_package_name], + cmdclass={ + 'set_version': set_version + }, ) |