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