From 2c61072cdc158804908909671ab67d91d280b774 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Sat, 18 Apr 2020 18:49:42 +0200 Subject: [PATCH] Use template to generate file with __version__ Fix #252 --- .tito/templates/__init__.py.tpl | 22 ++++++++++++++++++++++ .tito/tito.props | 4 ++++ src/tito/__init__.py | 7 +++++++ 3 files changed, 33 insertions(+) create mode 100644 .tito/templates/__init__.py.tpl diff --git a/.tito/templates/__init__.py.tpl b/.tito/templates/__init__.py.tpl new file mode 100644 index 0000000..3bec099 --- /dev/null +++ b/.tito/templates/__init__.py.tpl @@ -0,0 +1,22 @@ +# Copyright (c) 2008-2009 Red Hat, Inc. +# +# This software is licensed to you under the GNU General Public License, +# version 2 (GPLv2). There is NO WARRANTY for this software, express or +# implied, including the implied warranties of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 +# along with this software; if not, see +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. +# +# Red Hat trademarks are not licensed under GPLv2. No permission is +# granted to use or replicate Red Hat trademarks that are incorporated +# in this software or its documentation. + + +# WARNING: This file is generated from a tito template, do not edit it directly! + + +""" +Infrastructure for building Spacewalk and Satellite packages from git tags. +""" + +__version__ = '$version' diff --git a/.tito/tito.props b/.tito/tito.props index 644482f..189edfd 100644 --- a/.tito/tito.props +++ b/.tito/tito.props @@ -8,3 +8,7 @@ disttag = el5 [tag2] disttag = el5 + +[version_template] +destination_file = src/tito/__init__.py +template_file = .tito/templates/__init__.py.tpl diff --git a/src/tito/__init__.py b/src/tito/__init__.py index 42207ca..79bb597 100644 --- a/src/tito/__init__.py +++ b/src/tito/__init__.py @@ -10,6 +10,13 @@ # Red Hat trademarks are not licensed under GPLv2. No permission is # granted to use or replicate Red Hat trademarks that are incorporated # in this software or its documentation. + + +# WARNING: This file is generated from a tito template, do not edit it directly! + + """ Infrastructure for building Spacewalk and Satellite packages from git tags. """ + +__version__ = '0.6.13'