aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--requirements.txt2
-rw-r--r--setup.py4
-rw-r--r--sos.spec4
3 files changed, 8 insertions, 2 deletions
diff --git a/requirements.txt b/requirements.txt
index b4d120c1..4f6cbb74 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 c6ebb95c..9ad4bb75 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,9 @@ from sos import __version__ as VERSION
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 3cf24502..b575b523 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