From 4590bad67bb85b68b0fc30c89111cff65e092162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 27 Oct 2023 14:42:52 +0200 Subject: [PATCH] [build] Actually indicate this requires packaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup for 56904018045fdbdad666e55f0a850bc365809e50 I hereby declare that you can do whatever you want with this commit: Signed-off-by: Miro HronĨok --- requirements.txt | 2 +- setup.py | 4 +++- sos.spec | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b4d120c1c1..4f6cbb7430 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ coverage>=4.0.3 Sphinx>=1.3.5 pexpect>=4.0.0 pyyaml -setuptools +packaging diff --git a/setup.py b/setup.py index c6ebb95c30..9ad4bb75f4 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,9 @@ setup( name='sos', version=VERSION, - install_requires=['pexpect', 'pyyaml'], + # to avoid a packaging dependency on older RHELs + # we only declare it on recent Python versions + install_requires=['pexpect', 'pyyaml', 'packaging;python_version>="3.11"'], description=( 'A set of tools to gather troubleshooting information from a system' ), diff --git a/sos.spec b/sos.spec index 3cf245028b..b575b5232d 100644 --- a/sos.spec +++ b/sos.spec @@ -10,7 +10,11 @@ BuildRequires: python3-devel BuildRequires: python3-setuptools Requires: python3-rpm Requires: python3-pexpect +%if 0%{?rhel} && 0%{?rhel} < 10 Requires: python3-setuptools +%else +Requires: python3-packaging +%endif Recommends: python3-magic # Mandatory just for uploading to a SFTP server: Recommends: python3-requests