[PATCH 5/5] tuna: Get the tuna version from a single source
John Kacur <[email protected]> Tue, 28 Jul 2026 13:06:07 -0400
| Newsgroups | org.kernel.vger.linux-rt-users |
|---|---|
| Message-ID | <[email protected]> |
Create tuna/version.py with a TUNA_VERSION variable as the single source for the version number. Changes: - Add tuna/version.py with a TUNA_VERSION variable - Update setup.py to import version from tuna.version - Update tuna-cmd.py to import version from tuna.version - Update pyproject.toml to use dynamic versioning via setuptools For future releases, only tuna/version.py needs to be updated. All other files (setup.py, tuna-cmd.py, pyproject.toml) automatically pick up the version from this single source. Version updated from 0.20 to 0.21. Assisted-by: Claude:claude-sonnet-4-5 Signed-off-by: John Kacur <[email protected]> --- pyproject.toml | 5 ++++- setup.py | 5 ++++- tuna-cmd.py | 3 ++- tuna/version.py | 7 +++++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 tuna/version.py diff --git a/pyproject.toml b/pyproject.toml index ca149c352df0..6f995cb4c0a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "tuna" -version = "0.20" +dynamic = ["version"] description = "Application tuning GUI" license = "GPL-2.0-only" authors = [ @@ -37,5 +37,8 @@ Source = "https://git.kernel.org/pub/scm/utils/tuna/tuna.git/" tuna = "tuna.tuna:main" oscilloscope = "tuna.oscilloscope:main" +[tool.setuptools.dynamic] +version = {attr = "tuna.version.TUNA_VERSION"} + [tool.setuptools.packages.find] include = ["tuna*"] diff --git a/setup.py b/setup.py index a40f29ef3817..8036a647f698 100755 --- a/setup.py +++ b/setup.py @@ -5,6 +5,9 @@ import sysconfig from os.path import isfile, relpath from setuptools import setup +# Get the tuna version from a single source +from tuna.version import TUNA_VERSION + if isfile("MANIFEST"): os.unlink("MANIFEST") @@ -16,7 +19,7 @@ if SCHEME not in sysconfig.get_scheme_names(): PYTHONLIB = relpath(sysconfig.get_path('platlib', SCHEME), '/usr') setup(name="tuna", - version = "0.20", + version = TUNA_VERSION, description = "Application tuning GUI", author = "Arnaldo Carvalho de Melo, John Kacur", author_email = "[email protected], [email protected]", diff --git a/tuna-cmd.py b/tuna-cmd.py index 25515d5ddd5a..62972cdd328a 100755 --- a/tuna-cmd.py +++ b/tuna-cmd.py @@ -23,6 +23,7 @@ import tuna.tuna_sched as tuna_sched import procfs from tuna import tuna, sysfs, utils from tuna import cpuset +from tuna.version import TUNA_VERSION import logging import time import shutil @@ -162,7 +163,7 @@ def gen_parser(): MODS = { "logging": dict(dest='loglevel', metavar='LOG-LEVEL', type=get_loglevel, help="Log application details to file for given LOG-LEVEL"), "debug" : dict(action='store_true', dest='debug', help='Print DEBUG level logging details to console'), - "version": dict(action='version', version='0.20', help="show version"), + "version": dict(action='version', version=TUNA_VERSION, help="show version"), "warn": dict(action='store_true', dest='warn', help='Warn when thread/IRQ patterns match nothing'), "threads": dict(dest='thread_list', default='', metavar='THREAD-LIST', type=str, help="THREAD-LIST affected by commands"), "irqs": dict(dest='irq_list', default='', metavar='IRQ-LIST', type=str, help="IRQ-LIST affect by commands"), diff --git a/tuna/version.py b/tuna/version.py new file mode 100644 index 000000000000..23f503e6b1bc --- /dev/null +++ b/tuna/version.py @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright 2008 - 2009 Arnaldo Carvalho de Melo <[email protected]> +# Copyright 2015 - 2026 John Kacur <[email protected]> +# + +TUNA_VERSION = '0.21' -- 2.55.0