From patchwork Tue Feb 21 19:58:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 656196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA0C6C61DA3 for ; Tue, 21 Feb 2023 19:59:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjBUT7S (ORCPT ); Tue, 21 Feb 2023 14:59:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjBUT7I (ORCPT ); Tue, 21 Feb 2023 14:59:08 -0500 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8C287ECF for ; Tue, 21 Feb 2023 11:59:07 -0800 (PST) Received: by mail-qt1-x82b.google.com with SMTP id h19so2816492qtk.7 for ; Tue, 21 Feb 2023 11:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=18Nb3voZt40snAS0ir9baegCbM8+ROn/8qsmHrSzbU0=; b=g1YiyJcK5J/p+CFQ6LLO2R0eqWZlvYNDO0NHf6pKWhG9Lz5KlVeX9Y5iqDCSn6Wbjp P5AgqYIe1z+wwpsRIKMNbyorsdYpmgFVRmuI4uH0KfZ0d58XRQUH6/jBk7a/RG+24nue r0nvG+wj4xf3zU533Qo1qtH4JnhZgy+uwCm/Iy5nzbWtxrOkCHPFSAPUtfw+t0mhFEvE aLrtjl+lXPCSWY+0KzyFQhoHJ1xoUcH9E4qeRx/Fe3USijHZ9quGHZ3eXs7lH184CiFp MKRB0tn+Fk1c+RAerli4QTzwu9Wk0llI/PSGoJ834XCl+L0bzlxTj48/tnCuwfDB9Mdz 6oMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=18Nb3voZt40snAS0ir9baegCbM8+ROn/8qsmHrSzbU0=; b=YbVic4axe9IDsE3+/j+jMTuS3V6JOzlDnHCK9+U9DSA68jkcHG5sbSQpJq1uAzWOCm ATRSne/DldxbdRLWJ+ZrOC/UEvgqkXNDwDMwiaxDFtyN7Nww8LMJDrV6CWECeZFMpMvv GHhR9PthJbZy8IoEnIdv8cYh3GaOpawV6wqIwAwDyQfw2UcKH32FGlklzZPx+hk2W6rQ WdT29Sh08tDcxqkmHG+SAt/3NQ8UxFrexkwo2qH7ZxvWwgiajTD35rdYQL2/ot0fG28v 0DjLSWDg+693J0H315zp7WUijGPTmux2CRpw1L5K1jy8meT+qoPCmoWfp4Y4vBT3faTp Om9Q== X-Gm-Message-State: AO0yUKUOQOLHKdm38qfv1ItIlkaXEV1ATt69jU1OcqYLjn/KWimErloo RCPuiIV86Xa2Q4i246xyGr0kGyGMtL0= X-Google-Smtp-Source: AK7set9mlsWakFJ193+yfwWoYjK6qD8RoT+VswQv0EoGKwllnGux4Q27zJvyIxCZNjbB5svOeK+AGw== X-Received: by 2002:a05:622a:1cd:b0:3bf:a3fc:c70a with SMTP id t13-20020a05622a01cd00b003bfa3fcc70amr5925433qtw.28.1677009545654; Tue, 21 Feb 2023 11:59:05 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-14-76-71-123-7.dsl.bell.ca. [76.71.123.7]) by smtp.gmail.com with ESMTPSA id r21-20020a37a815000000b00742301f1bfbsm758934qke.45.2023.02.21.11.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 11:59:04 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Kate Carcia Poulin , John Kacur Subject: [PATCH 12/14] rteval: Use sysconfig instead of deprecated distutils Date: Tue, 21 Feb 2023 14:58:26 -0500 Message-Id: <20230221195828.17919-2-jkacur@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221195828.17919-1-jkacur@redhat.com> References: <20230221195828.17919-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Use sysconfig instead of deprecated distutils to add the rteval directory to the module search path. Signed-off-by: John Kacur --- rteval/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rteval/__init__.py b/rteval/__init__.py index d8127425febe..a245ef935568 100644 --- a/rteval/__init__.py +++ b/rteval/__init__.py @@ -37,7 +37,7 @@ import sys import threading import time from datetime import datetime -from distutils import sysconfig +import sysconfig from rteval.modules.loads import LoadModules from rteval.modules.measurement import MeasurementModules, MeasurementProfile from rteval.rtevalReport import rtevalReport @@ -99,7 +99,12 @@ class RtEval(rtevalReport): raise RuntimeError(f"can't find XSL template ({self.__rtevcfg.xslt_report})!") # Add rteval directory into module search path - sys.path.insert(0, f'{sysconfig.get_python_lib()}/rteval') + scheme = 'rpm_prefix' + if scheme not in sysconfig.get_scheme_names(): + scheme = 'posix_prefix' + pypath = f"{sysconfig.get_path('platlib', scheme)}/rteval" + sys.path.insert(0, pypath) + self.__logger.log(Log.DEBUG, f"Adding {pypath} to search path") # Initialise the report module rtevalReport.__init__(self, self.__version, From patchwork Tue Feb 21 19:58:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 656195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9023C64EC4 for ; Tue, 21 Feb 2023 19:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjBUT7U (ORCPT ); Tue, 21 Feb 2023 14:59:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbjBUT7O (ORCPT ); Tue, 21 Feb 2023 14:59:14 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B73A2303CF for ; Tue, 21 Feb 2023 11:59:09 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id k20so2244845qtj.5 for ; Tue, 21 Feb 2023 11:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=G1yFFmjsuxmcfkd8iqXP86Q5Z7r+yaaCZCdZFp2Nys0=; b=NkgprnGteLGc/YtngKeuSDUhJz9nsWAFDq0jiCt9JOsL8jAccHHNO49zOS+8pZ9lJS 6EOLPKRqstKxhjAmab9bkAHlM2HXoywyCdD+IipxtF+E9zfqwzc/rDE26viqStqNVjo5 vx98P+UiI6N27G7Htdjqx1yurq+EL7imjhahh1htgUmHUxnLEVmpvqkPRFsshe3v/ZlQ GoKvPue8hos1cZLd+Jfe6Ih5FR0gKWhU/YNpXNnEyQaAtzqlvhwcG4S3IkBLcVNlqI9w M6ztSUCcVgUXWZGebQ8jWh0hNDcyY38uwxnO4kyGUG19wq43uno5HPLRlKZl1S06P1Z2 cUXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=G1yFFmjsuxmcfkd8iqXP86Q5Z7r+yaaCZCdZFp2Nys0=; b=OsexMy43yDOWgT5lKgRwesgul3YXHQcl2ZCqpiGvtoQe3yHmf3ng5DWx+/CQCSb4EP 7GtdiWAkGV2608PMAjvg0mSyTKBkmO/e201sKhjQtyMUa4wPc6Acu/BzjQ+a1nFMnhiu 7xVfcGfmbsIk+mTYu9eFMWCWe4TYPL582lpRJMsH25fOBqic2aNT2P5pz6A084gnR729 S2Rex5y0ooLemLNEcSG8ZC9gccf/Xv0TrtCO8twteu9VydXBrYT2QVyGJdfvd0ew16A6 X229L4fqMpWHsVDvkn0xebZkl02zFtPDiMsTDHJAgOzhC4H+VKzLWVSQhYblksB1w6kC Ud+w== X-Gm-Message-State: AO0yUKXk4fceyX3sTMKmlro7hgcgFtaOrxOFN2ZIEwghPqHjrgD5zK2q jxrdOKh1sXzKFlILHwXfzK0s/oaxv5M= X-Google-Smtp-Source: AK7set+JHGqh5v4a8gxGzI9dOE8dmPKh+6GKICiERJvQ7jylHvdPkXj8utni3le8noileAKC9JrHAg== X-Received: by 2002:a05:622a:11cc:b0:3bd:15d4:ff65 with SMTP id n12-20020a05622a11cc00b003bd15d4ff65mr8592872qtk.40.1677009548048; Tue, 21 Feb 2023 11:59:08 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-14-76-71-123-7.dsl.bell.ca. [76.71.123.7]) by smtp.gmail.com with ESMTPSA id r21-20020a37a815000000b00742301f1bfbsm758934qke.45.2023.02.21.11.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 11:59:07 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Kate Carcia Poulin , John Kacur Subject: [PATCH 13/14] rteval: setup: Remove distutils and clean-ups Date: Tue, 21 Feb 2023 14:58:27 -0500 Message-Id: <20230221195828.17919-3-jkacur@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221195828.17919-1-jkacur@redhat.com> References: <20230221195828.17919-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Replace deprecated distutils with sysconfig and setuptools Clean-up a few other things in the file at the same time, such as the incorrect outdated git url. Signed-off-by: John Kacur --- setup.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 9a76ffbf89be..bcf7330553d4 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,18 @@ #!/usr/bin/python3 -from distutils.sysconfig import get_python_lib -from distutils.core import setup -from os.path import isfile, join -import glob, os, shutil, gzip +""" install rteval """ +import sysconfig +from os.path import relpath +import os +import shutil +import gzip +from setuptools import setup # Get PYTHONLIB with no prefix so --prefix installs work. -PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages') +SCHEME = 'rpm_prefix' +if SCHEME not in sysconfig.get_scheme_names(): + SCHEME = 'posix_prefix' +PYTHONLIB = relpath(sysconfig.get_path('platlib', SCHEME), '/usr') # Tiny hack to make rteval-cmd become a rteval when building/installing the package try: @@ -28,19 +34,18 @@ from dist import RTEVAL_VERSION # Compress the man page, so distutil will only care for the compressed file mangz = gzip.GzipFile('dist/rteval.8.gz', 'w', 9) -man = open('doc/rteval.8', 'rb') -mangz.writelines(man) -man.close() +with open('doc/rteval.8', 'rb') as man: + mangz.writelines(man) mangz.close() -# Do the distutils stuff +# Do the setup stuff setup(name="rteval", version = RTEVAL_VERSION, description = "Evaluate system performance for Realtime", author = "Clark Williams, David Sommerseth", author_email = "williams@redhat.com, davids@redhat.com", - url = "https://git.kernel.org/?p=linux/kernel/git/clrkwllms/rteval.git;a=summary", + url = "https://git.kernel.org/pub/scm/utils/rteval/rteval.git", license = "GPLv2", long_description = """\ @@ -79,8 +84,6 @@ mean, variance and standard deviation) and a report is generated. os.unlink('dist/rteval') os.unlink('dist/rteval.8.gz') os.unlink('dist/__init__.py') -# TODO FIX THIS, or at least find out why it was there -#os.unlink('dist/__init__.pyc') if distcreated: try: From patchwork Tue Feb 21 19:58:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 655628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 189AFC61DA3 for ; Tue, 21 Feb 2023 19:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjBUT7W (ORCPT ); Tue, 21 Feb 2023 14:59:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbjBUT7R (ORCPT ); Tue, 21 Feb 2023 14:59:17 -0500 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 546D730E83 for ; Tue, 21 Feb 2023 11:59:12 -0800 (PST) Received: by mail-qv1-xf2a.google.com with SMTP id ff4so6114937qvb.2 for ; Tue, 21 Feb 2023 11:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=QYXobIvVTgGsW9oGJD74hfQDZ0Za6YQQ4h/YjlaBOV4=; b=iGm9TnApIbH02EBIeijL1Q4Q89OcTqypdHfMpcmiC4rdcNhRWscUj4p1qIc+/WyJhj kwFZHIfetU4ZwYFNeK60gLhROMK40AjpuhtcfBFZ4fJZnfIG2/1uLT1x0sWaVqu75KPr MO0fEUp/xIg7Jf7jabNvRxr1fuoC1hIoKFyl5kEn5NpA++x6nontVeGXi+3IHRifusbK fxjjWk3iP0i2rGjUzNrNGWQTP0oxQ0lH2uW2Yz70m4z8Ts9GzS8HE8HmwzG4eLyXh1G/ 4aEIxaxhGDEfB3fvRrL1FK22/ljd56EjOVM1h1quQD0aj0L0nC87CvuzeXzE0YHhc2X0 z4mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QYXobIvVTgGsW9oGJD74hfQDZ0Za6YQQ4h/YjlaBOV4=; b=xrKnmyiXDx75lzZebCIEqAmin6RhnK/0DnU+xnN6iu+E12fr5obmlzCWazGZqgh31A ub/jvQJaEt/A86Jgw36XDmvnIU/spAInvNdDfbzgAJQC6GbZ/+pjaN3pCzX8fpdPsFYd fVPCEr34TUtBGtiRP8yCQmPBH7giOamUBwDTKL+5W9D2Mbuzvro54Jox4uyDagas8LXu mokonRzRPyyW2kU84P/8gFeFMTeJvNp54iF6Q2KqOyOyjVcqRZRAvCDn9KCW8GtKO+N4 W/91vrY9l13cJ/XQSwz7bpH+0/Jc+uDrj9o/QRCM2vwmS8INzzJ7i/SLlviDmp0XnA7F I0rg== X-Gm-Message-State: AO0yUKUmjWrdI/XA1mLy23Ok3AqtaACMdBf0lNo+RKVOmGFgmnxOdhpF 9fqgCf9Mmlj9kQLbjxoCYk14kiRzkDg= X-Google-Smtp-Source: AK7set/ZSo1EaqGDO9U8134cyRDape3hBA6WSQ0Jk1Tg9fe6mMgMOtOVLeiIN8gS1LyA1U9/IL3yqw== X-Received: by 2002:a05:6214:20aa:b0:53a:bf63:b053 with SMTP id 10-20020a05621420aa00b0053abf63b053mr7888172qvd.45.1677009549743; Tue, 21 Feb 2023 11:59:09 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-14-76-71-123-7.dsl.bell.ca. [76.71.123.7]) by smtp.gmail.com with ESMTPSA id r21-20020a37a815000000b00742301f1bfbsm758934qke.45.2023.02.21.11.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 11:59:08 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Kate Carcia Poulin , John Kacur Subject: [PATCH 14/14] rteval: Update version number to v3.6 Date: Tue, 21 Feb 2023 14:58:28 -0500 Message-Id: <20230221195828.17919-4-jkacur@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221195828.17919-1-jkacur@redhat.com> References: <20230221195828.17919-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Update version number to v3.6 Signed-off-by: John Kacur --- rteval.spec | 2 +- rteval/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rteval.spec b/rteval.spec index f6cacc878582..d1d9d10a461b 100644 --- a/rteval.spec +++ b/rteval.spec @@ -2,7 +2,7 @@ %{!?python_ver: %define python_ver %(%{__python} -c "import sys ; print sys.version[:3]")} Name: rteval -Version: 3.5 +Version: 3.6 Release: 1%{?dist} Summary: Utility to evaluate system suitability for RT Linux diff --git a/rteval/version.py b/rteval/version.py index 3c352e16997b..bedec09c0bdf 100644 --- a/rteval/version.py +++ b/rteval/version.py @@ -23,4 +23,4 @@ # are deemed to be part of the source code. # -RTEVAL_VERSION = '3.5' +RTEVAL_VERSION = '3.6'