From 726ffcefd20d761bcbe3482336cced45563db40d Mon Sep 17 00:00:00 2001 From: John Kacur Date: Fri, 31 Oct 2025 18:27:04 -0400 Subject: [PATCH] Convert spec file to use pyproject.toml build system - Convert spec file to use pyproject.toml build system - Add 8 patches from upstream (spelling fixes, typo corrections, cleanups) - Modernize packaging with %pyproject_wheel and %pyproject_install macros - Bump release to 3.9-6 Resolves: RHEL-114900 Signed-off-by: John Kacur --- ...ject.toml-for-modern-Python-packagin.patch | 102 ++++++++++++++++++ ...MANIFEST.in-and-fix-newnet.py-copyri.patch | 42 ++++++++ ...ing-of-occurrences-in-measurement-mo.patch | 66 ++++++++++++ rteval-Fix-typo-in-comment.patch | 28 +++++ ...emove-unused-function-remove_offline.patch | 33 ++++++ rteval-cyclictest-Fix-typo-in-comment.patch | 28 +++++ ...fig-Remove-redundant-is-True-compari.patch | 30 ++++++ rteval-timerlat-Fix-typo-in-log-message.patch | 28 +++++ rteval.spec | 41 +++++-- 9 files changed, 387 insertions(+), 11 deletions(-) create mode 100644 rteval-Add-pyproject.toml-for-modern-Python-packagin.patch create mode 100644 rteval-Clean-up-MANIFEST.in-and-fix-newnet.py-copyri.patch create mode 100644 rteval-Fix-spelling-of-occurrences-in-measurement-mo.patch create mode 100644 rteval-Fix-typo-in-comment.patch create mode 100644 rteval-Remove-unused-function-remove_offline.patch create mode 100644 rteval-cyclictest-Fix-typo-in-comment.patch create mode 100644 rteval-rtevalConfig-Remove-redundant-is-True-compari.patch create mode 100644 rteval-timerlat-Fix-typo-in-log-message.patch diff --git a/rteval-Add-pyproject.toml-for-modern-Python-packagin.patch b/rteval-Add-pyproject.toml-for-modern-Python-packagin.patch new file mode 100644 index 0000000..c13aceb --- /dev/null +++ b/rteval-Add-pyproject.toml-for-modern-Python-packagin.patch @@ -0,0 +1,102 @@ +From 65554081a01bf507224ce6f9ff950936e265241c Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 31 Oct 2025 15:47:47 -0400 +Subject: [PATCH 8/8] rteval: Add pyproject.toml for modern Python packaging + +Add pyproject.toml to support modern PEP 517/518/621 packaging while +keeping setup.py for backwards compatibility with older distributions. + +The pyproject.toml provides project metadata (name, version, dependencies, +authors) and works alongside setup.py which handles script installation +(copying rteval-cmd to rteval). + +Requires Python >=3.10 and setuptools >=61.0. + +Assisted-by: Claude +Signed-off-by: John Kacur +--- + pyproject.toml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ + rteval-cmd | 2 +- + 2 files changed, 59 insertions(+), 1 deletion(-) + create mode 100644 pyproject.toml + +diff --git a/pyproject.toml b/pyproject.toml +new file mode 100644 +index 000000000000..9fc681f3f91b +--- /dev/null ++++ b/pyproject.toml +@@ -0,0 +1,58 @@ ++[build-system] ++requires = ["setuptools>=61.0", "wheel"] ++build-backend = "setuptools.build_meta" ++ ++[project] ++name = "rteval" ++dynamic = ["version"] ++description = "Evaluate system performance for Realtime" ++readme = {text = """\ ++The rteval script is used to judge the behavior of a hardware ++platform while running a Realtime Linux kernel under a moderate ++to heavy load. ++ ++Provides control logic for starting a system load and then running a ++response time measurement utility (cyclictest) for a specified amount ++of time. When the run is finished, the sample data from cyclictest is ++analyzed for standard statistical measurements (i.e mode, median, range, ++mean, variance and standard deviation) and a report is generated. ++""", content-type = "text/plain"} ++requires-python = ">=3.10" ++license = {text = "GPL-2.0-or-later"} ++dependencies = [ ++ "lxml", ++ "requests", ++] ++authors = [ ++ {name = "Clark Williams", email = "williams@redhat.com"}, ++ {name = "David Sommerseth", email = "davids@redhat.com"}, ++ {name = "John Kacur", email = "jkacur@redhat.com"}, ++] ++maintainers = [ ++ {name = "John Kacur", email = "jkacur@redhat.com"}, ++] ++ ++[project.urls] ++Homepage = "https://git.kernel.org/pub/scm/utils/rteval/rteval.git" ++ ++[tool.setuptools] ++packages = [ ++ "rteval", ++ "rteval.modules", ++ "rteval.modules.loads", ++ "rteval.modules.measurement", ++ "rteval.sysinfo" ++] ++ ++[tool.setuptools.dynamic] ++version = {attr = "rteval.version.RTEVAL_VERSION"} ++ ++[tool.setuptools.package-dir] ++rteval = "rteval" ++"rteval.modules" = "rteval/modules" ++"rteval.modules.loads" = "rteval/modules/loads" ++"rteval.modules.measurement" = "rteval/modules/measurement" ++"rteval.sysinfo" = "rteval/sysinfo" ++ ++[tool.setuptools.package-data] ++rteval = ["*.xsl", "rteval.conf"] +diff --git a/rteval-cmd b/rteval-cmd +index 7af179321fe2..8fd37b98b069 100755 +--- a/rteval-cmd ++++ b/rteval-cmd +@@ -307,7 +307,7 @@ if __name__ == '__main__': + default_kernel_file = ModuleParameters().get('source').get('default') + if os.path.exists(tarfl): + if rtevcfg.srcdownload == default_kernel_file: +- sys.exit("Default kernel already exists, will not download") ++ sys.exit(f"Default kernel {default_kernel_file} already exists, will not download") + prompt = input("Kernel already exists, download and overwrite anyway? (y/n) ") + prompt = prompt.lower() + if prompt in ('no', 'n'): +-- +2.51.1 + diff --git a/rteval-Clean-up-MANIFEST.in-and-fix-newnet.py-copyri.patch b/rteval-Clean-up-MANIFEST.in-and-fix-newnet.py-copyri.patch new file mode 100644 index 0000000..b102f08 --- /dev/null +++ b/rteval-Clean-up-MANIFEST.in-and-fix-newnet.py-copyri.patch @@ -0,0 +1,42 @@ +From 544566d95a75e4b3b7ee7a5e1e47dd7e7e34a132 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Fri, 31 Oct 2025 15:12:42 -0400 +Subject: [PATCH 7/8] rteval: Clean up MANIFEST.in and fix newnet.py copyright + header + +Remove unnecessary entries from MANIFEST.in (rteval-cmd inclusion and +dist/ exclusions) and fix the copyright header in newnet.py (remove +duplicate SPDX tag, fix missing email bracket, update year to 2025). + +Signed-off-by: John Kacur +--- + MANIFEST.in | 3 +-- + rteval/sysinfo/newnet.py | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/MANIFEST.in b/MANIFEST.in +index 82560a8f957b..fa6ed3ab7de5 100644 +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -1,3 +1,2 @@ +-include COPYING MANIFEST.in rteval-cmd ++include COPYING MANIFEST.in + recursive-include doc *.? *.txt +-exclude dist/rteval dist/rteval.8.gz +diff --git a/rteval/sysinfo/newnet.py b/rteval/sysinfo/newnet.py +index 5dd95ae94e19..07427bb27771 100644 +--- a/rteval/sysinfo/newnet.py ++++ b/rteval/sysinfo/newnet.py +@@ -1,8 +1,7 @@ + # SPDX-License-Identifier: GPL-2.0-or-later + ''' Module to obtain network information for the rteval report ''' + # +-# Copyright 2022 John Kacur + # + + import os +-- +2.51.1 + diff --git a/rteval-Fix-spelling-of-occurrences-in-measurement-mo.patch b/rteval-Fix-spelling-of-occurrences-in-measurement-mo.patch new file mode 100644 index 0000000..22a4904 --- /dev/null +++ b/rteval-Fix-spelling-of-occurrences-in-measurement-mo.patch @@ -0,0 +1,66 @@ +From ca2ef31957e21194907cdfae6995da1eb1f5905d Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 10:48:45 -0400 +Subject: [PATCH 1/8] rteval: Fix spelling of 'occurrences' in measurement + modules + +Fixed typo 'occurances' -> 'occurrences' in both cyclictest.py and +timerlat.py measurement modules for consistency. + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 6 +++--- + rteval/modules/measurement/timerlat.py | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index 3d25c20b69cb..f32ad2690f45 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -92,7 +92,7 @@ class RunData: + mid = int(self.__numsamples / 2) + 1 + + # mean, mode, and median +- occurances = 0 ++ occurrences = 0 + lastkey = -1 + for i in keys: + if mid > total and mid <= total + self.__samples[i]: +@@ -104,8 +104,8 @@ class RunData: + lastkey = i + total += self.__samples[i] + total_us += (i * self.__samples[i]) +- if self.__samples[i] > occurances: +- occurances = self.__samples[i] ++ if self.__samples[i] > occurrences: ++ occurrences = self.__samples[i] + self.__mode = i + self.__mean = float(total_us) / float(self.__numsamples) + +diff --git a/rteval/modules/measurement/timerlat.py b/rteval/modules/measurement/timerlat.py +index 5bfc495217ea..733929666784 100644 +--- a/rteval/modules/measurement/timerlat.py ++++ b/rteval/modules/measurement/timerlat.py +@@ -84,7 +84,7 @@ class TLRunData: + mid = int(self.__numsamples / 2) + 1 + + # mean, mode and median +- occurances = 0 ++ occurrences = 0 + lastkey = -1 + for i in keys: + if mid > total and mid <= total + self.__samples[i]: +@@ -96,8 +96,8 @@ class TLRunData: + lastkey = i + total += self.__samples[i] + total_us += i * self.__samples[i] +- if self.__samples[i] > occurances: +- occurances = self.__samples[i] ++ if self.__samples[i] > occurrences: ++ occurrences = self.__samples[i] + self.__mode = i + self.__mean = float(total_us) / float(self.__numsamples) + +-- +2.51.1 + diff --git a/rteval-Fix-typo-in-comment.patch b/rteval-Fix-typo-in-comment.patch new file mode 100644 index 0000000..ff7a483 --- /dev/null +++ b/rteval-Fix-typo-in-comment.patch @@ -0,0 +1,28 @@ +From fbdf84d07a512b49be5287e0f326a0ae0dd9082e Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 11:05:06 -0400 +Subject: [PATCH 2/8] rteval: Fix typo in comment + +Fixed typo 'summay.xml' -> 'summary.xml' in rteval-cmd comment. + +Signed-off-by: John Kacur +--- + rteval-cmd | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval-cmd b/rteval-cmd +index 4e13d312a24a..b936ade23d86 100755 +--- a/rteval-cmd ++++ b/rteval-cmd +@@ -68,7 +68,7 @@ def summarize(repfile, xslt): + xsltdoc = lxml.etree.parse(xsltfp) + xsltprs = lxml.etree.XSLT(xsltdoc) + +- # Load the summay.xml report - with some simple sanity checks ++ # Load the summary.xml report - with some simple sanity checks + with open(summaryfile, "r") as xmlfp: + xmldoc = lxml.etree.parse(xmlfp) + +-- +2.51.1 + diff --git a/rteval-Remove-unused-function-remove_offline.patch b/rteval-Remove-unused-function-remove_offline.patch new file mode 100644 index 0000000..936e676 --- /dev/null +++ b/rteval-Remove-unused-function-remove_offline.patch @@ -0,0 +1,33 @@ +From e18cc3a11f982609cba26da5a341ecb457630ebd Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 13:20:30 -0400 +Subject: [PATCH 3/8] rteval: Remove unused function remove_offline + +Remove unused function remove_offline() + +Signed-off-by: John Kacur +--- + rteval-cmd | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/rteval-cmd b/rteval-cmd +index b936ade23d86..7af179321fe2 100755 +--- a/rteval-cmd ++++ b/rteval-cmd +@@ -207,13 +207,6 @@ def parse_options(cfg, parser, cmdargs): + + return cmd_args + +-def remove_offline(cpulist): +- """ return cpulist in collapsed compressed form with only online cpus """ +- tmplist = expand_cpulist(cpulist) +- tmplist = SysTopology().online_cpulist(tmplist) +- return collapse_cpulist(tmplist) +- +- + if __name__ == '__main__': + from rteval.sysinfo import dmi + +-- +2.51.1 + diff --git a/rteval-cyclictest-Fix-typo-in-comment.patch b/rteval-cyclictest-Fix-typo-in-comment.patch new file mode 100644 index 0000000..fcf8651 --- /dev/null +++ b/rteval-cyclictest-Fix-typo-in-comment.patch @@ -0,0 +1,28 @@ +From 3aa64cc2846fbcfcf7597fffa9ae3eeea0ecc7c3 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 13:36:34 -0400 +Subject: [PATCH 5/8] rteval: cyclictest: Fix typo in comment + +Fixed typo 'runing' -> 'running' in comment. + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/cyclictest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py +index f32ad2690f45..f7039ab2749f 100644 +--- a/rteval/modules/measurement/cyclictest.py ++++ b/rteval/modules/measurement/cyclictest.py +@@ -270,7 +270,7 @@ class Cyclictest(rtevalModulePrototype): + + def _WorkloadTask(self): + if self.__started: +- # Don't restart cyclictest if it is already runing ++ # Don't restart cyclictest if it is already running + return + + self._log(Log.DEBUG, f'starting with cmd: {" ".join(self.__cmd)}') +-- +2.51.1 + diff --git a/rteval-rtevalConfig-Remove-redundant-is-True-compari.patch b/rteval-rtevalConfig-Remove-redundant-is-True-compari.patch new file mode 100644 index 0000000..8b14534 --- /dev/null +++ b/rteval-rtevalConfig-Remove-redundant-is-True-compari.patch @@ -0,0 +1,30 @@ +From 0830a556300ec44551bb78f0b1a2a687ac06d1f9 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 13:41:45 -0400 +Subject: [PATCH 6/8] rteval: rtevalConfig: Remove redundant 'is True' + comparison + +Simplified boolean check by removing redundant 'is True' comparison. +ConfigParsed() already returns a boolean value. + +Signed-off-by: John Kacur +--- + rteval/rtevalConfig.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py +index 0c2fc6b5761a..e0922c5adda6 100644 +--- a/rteval/rtevalConfig.py ++++ b/rteval/rtevalConfig.py +@@ -234,7 +234,7 @@ class rtevalConfig: + self.__info("no config file") + return + +- if self.ConfigParsed(cfgfile) is True: ++ if self.ConfigParsed(cfgfile): + # Don't try to reread this file if it's already been parsed + return + +-- +2.51.1 + diff --git a/rteval-timerlat-Fix-typo-in-log-message.patch b/rteval-timerlat-Fix-typo-in-log-message.patch new file mode 100644 index 0000000..9b8ec08 --- /dev/null +++ b/rteval-timerlat-Fix-typo-in-log-message.patch @@ -0,0 +1,28 @@ +From c27f77bf1c401efab7a046c532470d9ba45b1519 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Sun, 12 Oct 2025 13:29:20 -0400 +Subject: [PATCH 4/8] rteval: timerlat: Fix typo in log message + +Fixed typo 'sampples' -> 'samples' in debug log message. + +Signed-off-by: John Kacur +--- + rteval/modules/measurement/timerlat.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rteval/modules/measurement/timerlat.py b/rteval/modules/measurement/timerlat.py +index 733929666784..95fb7f136c25 100644 +--- a/rteval/modules/measurement/timerlat.py ++++ b/rteval/modules/measurement/timerlat.py +@@ -66,7 +66,7 @@ class TLRunData: + """ Calculate statistics """ + # Check to see if we have any samples. If there are 1 or 0, return + if self.__numsamples <= 1: +- self._log(Log.DEBUG, f"skipping {self.__id} ({self.__numsamples} sampples)") ++ self._log(Log.DEBUG, f"skipping {self.__id} ({self.__numsamples} samples)") + self.__mad = 0 + self.__stddev = 0 + return +-- +2.51.1 + diff --git a/rteval.spec b/rteval.spec index 1b97d14..c8d6744 100644 --- a/rteval.spec +++ b/rteval.spec @@ -1,6 +1,6 @@ Name: rteval Version: 3.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Utility to evaluate system suitability for RT Linux Group: Development/Tools @@ -10,7 +10,7 @@ Source0: https://www.kernel.org/pub/linux/utils/%{name}/%{name}-%{version}.tar.x BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: pyproject-rpm-macros Requires: python3-lxml Requires: python3-libxml2 Requires: realtime-tests @@ -39,6 +39,14 @@ Patch2: rteval-Change-the-default-interval-for-timerlat-to-1100us.patch Patch3: rteval-Change-default-measurement-module-to-cyclictest.patch Patch4: rteval-services.py-Fix-SyntaxWarning.patch Patch5: rteval-Make-timerlat-the-default-for-rteval.patch +Patch6: rteval-Fix-spelling-of-occurrences-in-measurement-mo.patch +Patch7: rteval-Fix-typo-in-comment.patch +Patch8: rteval-Remove-unused-function-remove_offline.patch +Patch9: rteval-timerlat-Fix-typo-in-log-message.patch +Patch10: rteval-cyclictest-Fix-typo-in-comment.patch +Patch11: rteval-rtevalConfig-Remove-redundant-is-True-compari.patch +Patch12: rteval-Clean-up-MANIFEST.in-and-fix-newnet.py-copyri.patch +Patch13: rteval-Add-pyproject.toml-for-modern-Python-packagin.patch %description The rteval script is a utility for measuring various aspects of @@ -51,26 +59,37 @@ to the screen. %prep %autosetup -v -p1 +# Delete setup.py so pyproject.toml build doesn't use it +rm -f setup.py +# Prepare rteval script for installation (save to a separate location to avoid directory conflict) +cp -p rteval-cmd %{_builddir}/rteval-script +# Compress man page +gzip -c doc/rteval.8 > %{_builddir}/rteval.8.gz %build -%{__python3} setup.py build +%pyproject_wheel %install -%{__python3} setup.py install --root=$RPM_BUILD_ROOT +%pyproject_install +%pyproject_save_files rteval +# Install the rteval script +install -D -m 0755 %{_builddir}/rteval-script %{buildroot}%{_bindir}/rteval +# Install the compressed man page +install -D -m 0644 %{_builddir}/rteval.8.gz %{buildroot}%{_mandir}/man8/rteval.8.gz -%files -%defattr(-,root,root,-) -%{python3_sitelib}/*.egg-info +%files -f %{pyproject_files} %doc README doc/rteval.txt %license COPYING -%dir %{_datadir}/%{name} -%{python3_sitelib}/rteval %{_mandir}/man8/rteval.8.gz -%config(noreplace) %{_sysconfdir}/rteval.conf -%{_datadir}/%{name}/rteval_*.xsl %{_bindir}/rteval %changelog +* Fri Oct 31 2025 John Kacur - 3.9-6 +- Convert spec file to use pyproject.toml build system +- Add 8 patches from upstream (spelling fixes, typo corrections, cleanups) +- Modernize packaging with %%pyproject_wheel and %%pyproject_install macros +Resolves: RHEL-114900 + * Thu Jun 19 2025 John Kacur - 3.9-5 - Make timerlat the default measurement module - Make the default interval 100us